Skip to content

Commit

Permalink
compiles and runs on windows
Browse files Browse the repository at this point in the history
but cant see anything
o_o
  • Loading branch information
Shaji Khan committed Oct 13, 2024
1 parent e67ca0a commit 066b849
Show file tree
Hide file tree
Showing 217 changed files with 128 additions and 18 deletions.
Binary file modified FileWriter.o
Binary file not shown.
Binary file modified LockFreeQueue.o
Binary file not shown.
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@ OPUS=`x86_64-w64-mingw32-pkg-config --cflags --libs opus opusfile`
LAME=
X11=
OPTIMIZE=
CC=x86_64-w64-mingw32-gcc
CPP=x86_64-w64-mingw32-g++ -std=c++17
CC=x86_64-w64-mingw32-gcc -g -mwindows
CPP=x86_64-w64-mingw32-g++ -std=c++17 -g -mwindows
DLFCN=-llibdl
endif
all: amprack

amprack: version.o FileWriter.o main.o rack.o presets.o SharedLibrary.o engine.o jack.o process.o util.o snd.o knob.o
$(CPP) *.o -o amprack $(GTK) $(LV2) $(JACK) $(OPTIMIZE) $(SNDFILE) $(OPUS) $(LAME) $(DLFCN)

main.o: main.cc main.h rack.o presets.o
main.o: main.cc main.h rack.o presets.o log.o
$(CPP) main.cc -c $(GTK) $(LV2) $(OPTIMIZE) -Wno-deprecated-declarations

log.o: log.c log.h
$(CC) log.c -c $(GTK)

rack.o: rack.cc rack.h settings.o knob.o pluginui.o
$(CPP) rack.cc -c $(GTK) $(LV2) $(OPTIMIZE)

Expand All @@ -49,7 +52,7 @@ presets.o: presets.cc presets.h
$(CPP) presets.cc -c $(GTK) $(OPTIMIZE) $(LV2) -Wno-deprecated-declarations

SharedLibrary.o: SharedLibrary.cpp SharedLibrary.h Plugin.cpp Plugin.h PluginControl.cpp PluginControl.h
$(CPP) SharedLibrary.cpp Plugin.cpp PluginControl.cpp lv2_ext.cpp -c $(LV2) $(OPTIMIZE)
$(CPP) SharedLibrary.cpp Plugin.cpp PluginControl.cpp lv2_ext.cpp -c $(LV2) $(OPTIMIZE) $(GTK)

engine.o: engine.cc engine.h snd.cc snd.h
$(CPP) engine.cc -c $(JACK) $(LV2) $(OPTIMIZE) $(SNDFILE) $(GTK)
Expand All @@ -65,20 +68,20 @@ test: lv2_test.c

ifeq ($(TARGET),linux)
jack.o: jack.cc jack.h
$(CC) jack.cc -c $(JACK)
$(CC) jack.cc -c $(JACK) $(GTK)
else
jack.o: pa.cc pa.h
$(CPP) pa.cc -c
$(CPP) pa.cc -c $(GTK)
endif

process.o: process.cc process.h
$(CC) process.cc -c
$(CC) process.cc -c $(GTK)

util.o: util.cc util.h
$(CPP) $(GTK) -c util.cc -Wno-deprecated-declarations

snd.o: snd.cc snd.h
$(CPP) snd.cc -c $(SNDFILE)
$(CPP) snd.cc -c $(SNDFILE) $(GTK)

knob.o: knob.cpp cairo.cpp objects.cpp dictionary.cpp mem.cpp pango.cpp
#~ cc -c `pkg-config gtk4 --libs --cflags` GxRegler.cpp GxControlParameter.cpp -w -lm drawingutils.cpp GxKnob.cpp GxBigKnob.cpp
Expand All @@ -88,7 +91,7 @@ version.o:
echo \#define VERSION `git rev-list --count HEAD` > version.h

FileWriter.o: FileWriter.cpp FileWriter.h LockFreeQueue.cpp LockFreeQueue.h vringbuffer.o
$(CPP) upwaker.c vringbuffer.cc FileWriter.cpp LockFreeQueue.cpp $(OPUS) $(SNDFILE) -c -w $(JACK)
$(CPP) $(GTK) upwaker.c vringbuffer.cc FileWriter.cpp LockFreeQueue.cpp $(OPUS) $(SNDFILE) -c -w $(JACK)

vringbuffer.o: upwaker.c vringbuffer.cc
$(CPP) -fpermissive -c upwaker.c vringbuffer.cc
$(CPP) -fpermissive -c upwaker.c vringbuffer.cc $(GTK)
Binary file modified Plugin.o
Binary file not shown.
Binary file modified PluginControl.o
Binary file not shown.
Binary file modified SharedLibrary.o
Binary file not shown.
Binary file modified amprack.exe
Binary file not shown.
Binary file modified cairo.o
Binary file not shown.
2 changes: 1 addition & 1 deletion defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define yes true
#define no false
#define brake break
#define wtf printf
#define wtf LOGD

#ifdef How_to_dismantle_an_atomic_bomb
typedef void vodi ;
Expand Down
Binary file modified dictionary.o
Binary file not shown.
24 changes: 23 additions & 1 deletion engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,26 @@ bool Engine::openAudio () {
}

Engine::Engine () {
IN
#ifdef __linux__
struct utsname name;
if (uname (&name) == -1)
wtf ("cannot get system name!\n") ;
#else
wtf ("[discover] running on something not linux");
wtf ("profile: %s", getenv ("USERPROFILE"));
#endif

home = std::string (getenv("HOME")).append ("/amprack/recordings");
# ifdef __linux__
home = std::string (getenv("HOME")).append ("/amprack/recordings");
# else
home = std::string (getenv("USERPROFILE")).append ("/amprack/recordings");
# endif

g_mkdir_with_parents (home.c_str (), 0777);

LOGD ("home dir: %s", home.c_str ());

# ifdef __linux__
std::string _p_ = std::string ("libs/linux/").append (name.machine).append ("/") ;
# else
Expand Down Expand Up @@ -118,6 +129,7 @@ Engine::Engine () {
fileWriter = new FileWriter ();
queueManager.add_function (fileWriter->disk_write);
processor->lockFreeQueueManager = & queueManager ;
OUT
}


Expand Down Expand Up @@ -288,7 +300,12 @@ void Engine::set_plugin_audio_file (int index, char * filename) {

std::string path = std::string (filename) ;

# ifdef __linux__
std::string dir = std::string (getenv ("HOME")).append ("/amprack/models/").append (activePlugins->at (index)->lv2_name).append ("/");
# else
std::string dir = std::string (getenv ("USERPROFILE")).append ("/amprack/models/").append (activePlugins->at (index)->lv2_name).append ("/");
# endif

g_mkdir_with_parents (dir.c_str (), 0777) ;
copy_file (activePlugins->at (index)->loadedFileName, dir.append (path.substr(path.find_last_of("/") + 1)));

Expand Down Expand Up @@ -323,7 +340,12 @@ void Engine::set_plugin_file (int index, char * filename) {
std::string path = std::string (filename) ;
activePlugins->at (index)->loadedFileType = 1 ;

# ifdef __linux__
std::string dir = std::string (getenv ("HOME")).append ("/amprack/models/").append (activePlugins->at (index)->lv2_name).append ("/");
# else
std::string dir = std::string (getenv ("USERPROFILE")).append ("/amprack/models/").append (activePlugins->at (index)->lv2_name).append ("/");
# endif

g_mkdir_with_parents (dir.c_str (), 0777) ;
copy_file (activePlugins->at (index)->loadedFileName, dir.append (path.substr(path.find_last_of("/") + 1)));
//~ printf ("%s\n", buffer.str().c_str ());
Expand Down
Binary file modified engine.o
Binary file not shown.
Binary file modified knob.o
Binary file not shown.
Binary file added libs/win32/alias_1407.dll
Binary file not shown.
Binary file added libs/win32/allpass_1895.dll
Binary file not shown.
Binary file added libs/win32/am_pitchshift_1433.dll
Binary file not shown.
Binary file added libs/win32/amp_1181.dll
Binary file not shown.
Binary file added libs/win32/analogue_osc_1416.dll
Binary file not shown.
Binary file added libs/win32/bandpass_a_iir_1893.dll
Binary file not shown.
Binary file added libs/win32/bandpass_iir_1892.dll
Binary file not shown.
Binary file added libs/win32/bode_shifter_1431.dll
Binary file not shown.
Binary file added libs/win32/bode_shifter_cv_1432.dll
Binary file not shown.
Binary file added libs/win32/butterworth_1902.dll
Binary file not shown.
Binary file added libs/win32/chebstortion_1430.dll
Binary file not shown.
Binary file added libs/win32/comb_1190.dll
Binary file not shown.
Binary file added libs/win32/comb_1887.dll
Binary file not shown.
Binary file added libs/win32/comb_splitter_1411.dll
Binary file not shown.
Binary file added libs/win32/crossover_dist_1404.dll
Binary file not shown.
Binary file added libs/win32/decay_1886.dll
Binary file not shown.
Binary file added libs/win32/decimator_1202.dll
Binary file not shown.
Binary file added libs/win32/declip_1195.dll
Binary file not shown.
Binary file added libs/win32/delay_1898.dll
Binary file not shown.
Binary file added libs/win32/delayorama_1402.dll
Binary file not shown.
Binary file added libs/win32/diode_1185.dll
Binary file not shown.
Binary file added libs/win32/divider_1186.dll
Binary file not shown.
Binary file added libs/win32/dj_eq_1901.dll
Binary file not shown.
Binary file added libs/win32/dj_flanger_1438.dll
Binary file not shown.
Binary file added libs/win32/dyson_compress_1403.dll
Binary file not shown.
Binary file added libs/win32/fad_delay_1192.dll
Binary file not shown.
Binary file added libs/win32/fast_lookahead_limiter_1913.dll
Binary file not shown.
Binary file added libs/win32/flanger_1191.dll
Binary file not shown.
Binary file added libs/win32/fm_osc_1415.dll
Binary file not shown.
Binary file added libs/win32/foldover_1213.dll
Binary file not shown.
Binary file added libs/win32/foverdrive_1196.dll
Binary file not shown.
Binary file added libs/win32/freq_tracker_1418.dll
Binary file not shown.
Binary file added libs/win32/gate_1410.dll
Binary file not shown.
Binary file added libs/win32/giant_flange_1437.dll
Binary file not shown.
Binary file added libs/win32/gong_1424.dll
Binary file not shown.
Binary file added libs/win32/gong_beater_1439.dll
Binary file not shown.
Binary file added libs/win32/gverb_1216.dll
Binary file not shown.
Binary file added libs/win32/gx_AxisFace.dll
Binary file not shown.
Binary file added libs/win32/gx_AxisFace_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_CreamMachine.dll
Binary file not shown.
Binary file added libs/win32/gx_CreamMachine_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_DOP250.dll
Binary file not shown.
Binary file added libs/win32/gx_DOP250_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_Heathkit.dll
Binary file not shown.
Binary file added libs/win32/gx_Heathkit_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_KnightFuzz.dll
Binary file not shown.
Binary file added libs/win32/gx_KnightFuzz_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_MicroAmp.dll
Binary file not shown.
Binary file added libs/win32/gx_MicroAmp_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_SunFace.dll
Binary file not shown.
Binary file added libs/win32/gx_SunFace_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_TubeDistortion.dll
Binary file not shown.
Binary file added libs/win32/gx_TubeDistortion_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_ampegsvt.dll
Binary file not shown.
Binary file added libs/win32/gx_ampegsvt_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_bajatubedriver.dll
Binary file not shown.
Binary file added libs/win32/gx_bajatubedriver_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_blueamp.dll
Binary file not shown.
Binary file added libs/win32/gx_blueamp_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_boobtube.dll
Binary file not shown.
Binary file added libs/win32/gx_boobtube_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_bottlerocket.dll
Binary file not shown.
Binary file added libs/win32/gx_bottlerocket_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_clubdrive.dll
Binary file not shown.
Binary file added libs/win32/gx_clubdrive_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_epic.dll
Binary file not shown.
Binary file added libs/win32/gx_epic_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_eternity.dll
Binary file not shown.
Binary file added libs/win32/gx_eternity_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_guvnor.dll
Binary file not shown.
Binary file added libs/win32/gx_guvnor_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_hotbox.dll
Binary file not shown.
Binary file added libs/win32/gx_hotbox_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_hyperion.dll
Binary file not shown.
Binary file added libs/win32/gx_hyperion_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_liquiddrive.dll
Binary file not shown.
Binary file added libs/win32/gx_liquiddrive_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_luna.dll
Binary file not shown.
Binary file added libs/win32/gx_luna_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_maestro_fz1b.dll
Binary file not shown.
Binary file added libs/win32/gx_maestro_fz1b_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_maestro_fz1s.dll
Binary file not shown.
Binary file added libs/win32/gx_maestro_fz1s_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_plexi.dll
Binary file not shown.
Binary file added libs/win32/gx_plexi_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_quack.dll
Binary file not shown.
Binary file added libs/win32/gx_quack_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_saturate.dll
Binary file not shown.
Binary file added libs/win32/gx_saturate_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_sd1sim.dll
Binary file not shown.
Binary file added libs/win32/gx_sd1sim_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_sd2lead.dll
Binary file not shown.
Binary file added libs/win32/gx_sd2lead_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_sfp.dll
Binary file not shown.
Binary file added libs/win32/gx_sfp_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_shakatube.dll
Binary file not shown.
Binary file added libs/win32/gx_shakatube_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_sloopyblue.dll
Binary file not shown.
Binary file added libs/win32/gx_sloopyblue_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_slowgear.dll
Binary file not shown.
Binary file added libs/win32/gx_slowgear_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_supersonic.dll
Binary file not shown.
Binary file added libs/win32/gx_supersonic_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_timray.dll
Binary file not shown.
Binary file added libs/win32/gx_timray_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_tonemachine.dll
Binary file not shown.
Binary file added libs/win32/gx_tonemachine_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_ultracab.dll
Binary file not shown.
Binary file added libs/win32/gx_ultracab_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_uvox.dll
Binary file not shown.
Binary file added libs/win32/gx_uvox_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_valvecaster.dll
Binary file not shown.
Binary file added libs/win32/gx_valvecaster_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_vfm.dll
Binary file not shown.
Binary file added libs/win32/gx_vfm_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_vmk2d.dll
Binary file not shown.
Binary file added libs/win32/gx_vmk2d_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_voodoo.dll
Binary file not shown.
Binary file added libs/win32/gx_voodoo_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_voxbass.dll
Binary file not shown.
Binary file added libs/win32/gx_voxbass_ui.dll
Binary file not shown.
Binary file added libs/win32/gx_vstb.dll
Binary file not shown.
Binary file added libs/win32/gx_vstb_ui.dll
Binary file not shown.
Binary file added libs/win32/hard_limiter_1413.dll
Binary file not shown.
Binary file added libs/win32/harmonic_gen_1220.dll
Binary file not shown.
Binary file added libs/win32/hermes_filter_1200.dll
Binary file not shown.
Binary file added libs/win32/highpass_iir_1890.dll
Binary file not shown.
Binary file added libs/win32/hilbert_1440.dll
Binary file not shown.
Binary file added libs/win32/imp_1199.dll
Binary file not shown.
Binary file added libs/win32/impulse_1885.dll
Binary file not shown.
Binary file added libs/win32/inv_1429.dll
Binary file not shown.
Binary file added libs/win32/karaoke_1409.dll
Binary file not shown.
Binary file added libs/win32/latency_1914.dll
Binary file not shown.
Binary file added libs/win32/lcr_delay_1436.dll
Binary file not shown.
Binary file added libs/win32/libfftw3f-3.dll
Binary file not shown.
Binary file added libs/win32/lowpass_iir_1891.dll
Binary file not shown.
Binary file added libs/win32/ls_filter_1908.dll
Binary file not shown.
Binary file added libs/win32/matrix_ms_st_1421.dll
Binary file not shown.
Binary file added libs/win32/matrix_spatialiser_1422.dll
Binary file not shown.
Binary file added libs/win32/matrix_st_ms_1420.dll
Binary file not shown.
Binary file added libs/win32/mbeq_1197.dll
Binary file not shown.
Binary file added libs/win32/mod_delay_1419.dll
Binary file not shown.
Binary file added libs/win32/multivoice_chorus_1201.dll
Binary file not shown.
Binary file added libs/win32/notch_iir_1894.dll
Binary file not shown.
Binary file added libs/win32/phasers_1217.dll
Binary file not shown.
Binary file added libs/win32/pitch_scale_1193.dll
Binary file not shown.
Binary file added libs/win32/pitch_scale_1194.dll
Binary file not shown.
Binary file added libs/win32/plate_1423.dll
Binary file not shown.
Binary file added libs/win32/pointer_cast_1910.dll
Binary file not shown.
Binary file added libs/win32/rate_shifter_1417.dll
Binary file not shown.
Binary file added libs/win32/retro_flange_1208.dll
Binary file not shown.
Binary file added libs/win32/revdelay_1605.dll
Binary file not shown.
Binary file added libs/win32/ringmod_1188.dll
Binary file not shown.
Binary file added libs/win32/satan_maximiser_1408.dll
Binary file not shown.
Binary file added libs/win32/sc1_1425.dll
Binary file not shown.
Binary file added libs/win32/sc2_1426.dll
Binary file not shown.
Binary file added libs/win32/sc3_1427.dll
Binary file not shown.
Binary file added libs/win32/sc4_1882.dll
Binary file not shown.
Binary file added libs/win32/sc4m_1916.dll
Binary file not shown.
Binary file added libs/win32/se4_1883.dll
Binary file not shown.
Binary file added libs/win32/shaper_1187.dll
Binary file not shown.
Binary file added libs/win32/sifter_1210.dll
Binary file not shown.
Binary file added libs/win32/sin_cos_1881.dll
Binary file not shown.
Binary file added libs/win32/single_para_1203.dll
Binary file not shown.
Binary file added libs/win32/sinus_wavewrapper_1198.dll
Binary file not shown.
Binary file added libs/win32/smooth_decimate_1414.dll
Binary file not shown.
Binary file added libs/win32/split_1406.dll
Binary file not shown.
Binary file added libs/win32/step_muxer_1212.dll
Binary file not shown.
Binary file added libs/win32/surround_encoder_1401.dll
Binary file not shown.
Binary file added libs/win32/svf_1214.dll
Binary file not shown.
Binary file added libs/win32/tape_delay_1211.dll
Binary file not shown.
Binary file added libs/win32/transient_1206.dll
Binary file not shown.
Binary file added libs/win32/triple_para_1204.dll
Binary file not shown.
Binary file added libs/win32/valve_1209.dll
Binary file not shown.
Binary file added libs/win32/valve_rect_1405.dll
Binary file not shown.
Binary file added libs/win32/vynil_1905.dll
Binary file not shown.
Binary file added libs/win32/wave_terrain_1412.dll
Binary file not shown.
Binary file added libs/win32/xfade_1915.dll
Binary file not shown.
Binary file added libs/win32/zm1_1428.dll
Binary file not shown.
11 changes: 11 additions & 0 deletions log.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# include <gtk/gtk.h>
# include <windows.h>

int printf_windows (const char* format, ...) ;
int printf_windows (const char* format, ...) {
char * msg = g_strdup_printf (format);
//~ OutputDebugStringA (msg);
g_log_default_handler ("[amprack]", G_LOG_LEVEL_WARNING, msg, NULL);
g_free (msg);
return 0 ;
}
35 changes: 32 additions & 3 deletions log.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include <cstdlib>
#include <cmath>

#ifdef __ANDROID__
#include <android/log.h>

#ifndef MODULE_NAME
#define MODULE_NAME __FILE_NAME__
#endif

#ifdef __ANDROID__
#include <android/log.h>

#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, MODULE_NAME, __VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, MODULE_NAME, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, MODULE_NAME, __VA_ARGS__)
Expand All @@ -40,6 +40,10 @@
#define ASSERT(cond, ...) if (!(cond)) {__android_log_assert(#cond, MODULE_NAME, __VA_ARGS__);}
#else

#define logd(msg) g_log_default_handler (MODULE_NAME, G_LOG_LEVEL_WARNING, msg, NULL);


#ifdef __linux__
#define LOGI printf
#define LOGD printf
#define LOGW printf
Expand All @@ -51,6 +55,31 @@
#define IN printf(">> %s\n", __PRETTY_FUNCTION__);
#define OUT printf("<< %s \n", __PRETTY_FUNCTION__);

#else
#include <gtk/gtk.h>
#define IN printf_windows(">> %s\n", __PRETTY_FUNCTION__);
#define OUT printf_windows("<< %s \n", __PRETTY_FUNCTION__);
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif

int printf_windows (const char* format, ...) ;
#ifdef __cplusplus
}
#endif

#define LOGI printf_windows
#define LOGD printf_windows
#define LOGW printf_windows
#define LOGE printf_windows
#define LOGF printf_windows
#define ASSERT(cond, ...)
#define LOGV(arg) printf_windows("!! [%s: %d] %s\n", __FILE__, __LINE__, arg) ;
#define HERE printf_windows("!! %s: %d\n", __FILE__, __LINE__) ;

#endif

#endif

#endif // __SAMPLE_ANDROID_DEBUG_H__
Binary file added log.o
Binary file not shown.
Binary file modified lv2_ext.o
Binary file not shown.
12 changes: 11 additions & 1 deletion main.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "main.h"

void activate (GApplication * app, void * v) {
IN
//~ gtk_application_add_window ((GtkApplication *)app, window -> gobj ());
GtkCssProvider *cssProvider = gtk_css_provider_new();
GtkCssProvider *cssProvider2 = gtk_css_provider_new();
Expand All @@ -15,12 +16,18 @@ void activate (GApplication * app, void * v) {
gtk_css_provider_load_from_path(cssProvider, std::string ("/usr/share/amprack/assets/themes/").append (window.rack -> theme).append ("/style.css").c_str ());
gtk_style_context_add_provider_for_display (gdk_display_get_default (), (GtkStyleProvider *)cssProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);

# ifdef __linux__
std::string user_css = std::string (getenv ("HOME")).append ("/.config/amprack/style.css").c_str () ;
# else
std::string user_css = std::string (getenv ("USERPROFILE")).append ("/.config/amprack/style.css").c_str () ;
# endif

if (std::filesystem::exists (user_css))
gtk_css_provider_load_from_path(cssProvider2, user_css.c_str());
gtk_style_context_add_provider_for_display (gdk_display_get_default (), (GtkStyleProvider *)cssProvider2, GTK_STYLE_PROVIDER_PRIORITY_USER);

gtk_window_present ((GtkWindow *)window.window);
OUT
}

void position_changed (GtkPaned * pane, void *) {
Expand All @@ -29,6 +36,8 @@ void position_changed (GtkPaned * pane, void *) {

int main(int argc, char* argv[])
{
LOGD ("Rock and roll can never die");
IN
auto app = gtk_application_new ("org.acoustixaudio.amprack", G_APPLICATION_DEFAULT_FLAGS);

//~ window.set_title("Gtk4 Demo");
Expand Down Expand Up @@ -73,6 +82,7 @@ void toggle_effects (GtkToggleButton * button, MyWindow * window) {

MyWindow::MyWindow(GtkApplication * _app)
{
IN
app = _app ;
window = (GtkWindow *) gtk_application_window_new (app);
gtk_window_set_title(window, "Amp Rack 5 (Alpha)");
Expand Down Expand Up @@ -145,7 +155,7 @@ MyWindow::MyWindow(GtkApplication * _app)
//~ g_signal_connect (rack -> toggle_presets.gobj (), "clicked", (GCallback) toggle_effects, this);
//~ XWarpPointer(gdk_x11_display_get_xdisplay (gdk_display_get_default ()),0,0, 0, 0, 0, 0, 0,
//~ 0);

OUT
}

GtkWindow * MyWindow::gobj () {
Expand Down
5 changes: 5 additions & 0 deletions main.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ void quit (void * w, void * d) {
}

json_to_filename (favs, std::string (window -> presets -> dir).append ("/fav.json"));
# ifdef __linux__
json_to_filename (window -> rack->config, std::string (getenv ("HOME")).append ("/.config/amprack/config.json"));
# else
json_to_filename (window -> rack->config, std::string (getenv ("USERPROFILE")).append ("/.config/amprack/config.json"));
# endif

gtk_window_destroy ((GtkWindow *)window -> gobj ());
g_application_quit ((GApplication *)window -> app);
}
Expand Down
Binary file modified main.o
Binary file not shown.
Binary file modified mem.o
Binary file not shown.
Binary file modified objects.o
Binary file not shown.
Binary file modified pa.o
Binary file not shown.
Binary file modified pango.o
Binary file not shown.
10 changes: 10 additions & 0 deletions pluginui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ void select_model (GtkDropDown * down, int event, PluginUI * ui) {
}

const char * filename = gtk_string_object_get_string ((GtkStringObject *)gtk_drop_down_get_selected_item ((GtkDropDown *)down));
# ifdef __linux__
std::string dir = std::string (getenv ("HOME")).append ("/amprack/models/").append (std::string (gtk_label_get_text (ui -> name))).append ("/").append (std::string (filename));
# else
std::string dir = std::string (getenv ("USERPROFILE")).append ("/amprack/models/").append (std::string (gtk_label_get_text (ui -> name))).append ("/").append (std::string (filename));
# endif

wtf ("[model] %s\n", dir.c_str ());

if (ui -> engine -> activePlugins -> at (ui -> index) -> loadedFileType)
Expand Down Expand Up @@ -519,7 +524,12 @@ PluginUI::PluginUI (Engine * _engine, Plugin * _plugin, GtkBox * _parent, std::s
wtf ("[file chooser] mmmmph\n");
GtkWidget * box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_widget_set_hexpand (box, true);
# ifdef __linux__
std::string dir = std::string (getenv ("HOME")).append ("/amprack/models/").append (pluginName).append ("/");
# else
std::string dir = std::string (getenv ("USERPROFILE")).append ("/amprack/models/").append (pluginName).append ("/");
# endif

char ** entries = list_directory (dir);
GtkWidget * down = gtk_drop_down_new_from_strings (entries) ;
gtk_widget_set_hexpand (down, true);
Expand Down
Binary file modified pluginui.o
Binary file not shown.
10 changes: 10 additions & 0 deletions presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,20 @@ class Presets {
GtkAdjustment * adj ;

Presets () {
# ifdef __linux__
dir = std::string (getenv ("HOME")).append ("/.config/amprack") ;
# else
dir = std::string (getenv ("USERPROFILE")).append ("/.config/amprack") ;
# endif

LOGD ("[presets] dir: %s\n", dir.c_str ());

# ifdef __linux__
presets_dir = new std::string (getenv ("HOME"));
# else
presets_dir = new std::string (getenv ("USERPROFILE"));
# endif

presets_dir->append ("/amprack/presets/");
_pdir = strdup (presets_dir->c_str ());

Expand Down
Binary file modified presets.o
Binary file not shown.
Binary file modified process.o
Binary file not shown.
7 changes: 6 additions & 1 deletion rack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,13 @@ void launch_sync (void * a, void * c) {
Rack::Rack () {
engine = new Engine () ;
blacklist = filename_to_json ("assets/blacklist.json");


# ifdef __linux__
config = filename_to_json (std::string (getenv ("HOME")).append ("/.config/amprack/config.json"));
# else
config = filename_to_json (std::string (getenv ("USERPROFILE")).append ("/.config/amprack/config.json"));
# endif

if (config.contains ("theme")) {
theme = config ["theme"].dump ();
theme = theme.substr (1, theme.size () - 2);
Expand Down
Binary file modified rack.o
Binary file not shown.
Binary file modified settings.o
Binary file not shown.
Binary file modified snd.o
Binary file not shown.
Binary file modified upwaker.o
Binary file not shown.
5 changes: 5 additions & 0 deletions util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ void set_random_background (GtkWidget * widget) {
IN
#ifdef __GTK_ALERT_DIALOG_H__

# ifdef __linux__
std::string dir = std::string (getenv ("HOME")).append ("/amprack/backgrounds");
# else
std::string dir = std::string (getenv ("USERPROFILE")).append ("/amprack/backgrounds");
# endif

if (! std::filesystem::exists (dir))
return ;

Expand Down
Binary file modified util.o
Binary file not shown.
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION 137
#define VERSION 138
Binary file modified vringbuffer.o
Binary file not shown.

0 comments on commit 066b849

Please sign in to comment.