fix theme loading (commandline option -t), log samplebank layout, pass commandline option to gtk_init for debugging

This commit is contained in:
niels
2015-10-18 12:25:19 +02:00
parent 7973c3d597
commit 3f787ad307
2 changed files with 24 additions and 48 deletions

View File

@@ -211,34 +211,24 @@ int main(int argc, char *argv[]) {
clone_args( argv, argc );
gtk_init( &argc, &argv );
// default host to connect to
sprintf(hostname, "127.0.0.1");
snprintf(hostname,sizeof(hostname), "127.0.0.1");
while( ( n = getopt( argc, argv, "s:h:p:tnvHf:X:P:Vl:T:m:g:")) != EOF )
{
sprintf(option, "%c", n );
err += set_option( option, optarg);
if(err) usage(argv[0]);
}
if( optind > argc )
err ++;
while( ( n = getopt( argc, argv, "s:h:p:tnvHf:X:P:Vl:T:m:g:")) != EOF )
{
sprintf(option, "%c", n );
err += set_option( option, optarg);
if(err) usage(argv[0]);
}
if( optind > argc )
err ++;
if( err ) usage(argv[0]);
/*
if( !g_thread_supported() )
{
veejay_msg(2, "Initializing GDK threads");
g_thread_init(NULL);
gdk_threads_init(); // Called to initialize internal mutex "gdk_threads_mutex".
}*/
if( err ) usage(argv[0]);
gtk_init( NULL,NULL );
// gtk_init( &argc, &argv );
glade_init();
// g_mem_set_vtable( glib_mem_profiler_table );
vj_mem_init();
vevo_strict_init();

View File

@@ -5463,8 +5463,8 @@ static int select_f(const struct dirent *d )
static void set_default_theme()
{
sprintf( theme_path, "%s", RELOADED_DATADIR);
sprintf( theme_file, "%s/gveejay.rc", RELOADED_DATADIR );
snprintf( theme_path,sizeof(theme_path), "%s", RELOADED_DATADIR);
snprintf( theme_file,sizeof(theme_file), "%s/gveejay.rc", RELOADED_DATADIR );
use_default_theme_ = 1;
}
@@ -5478,8 +5478,6 @@ void find_user_themes(int theme)
veejay_memset( theme_file, 0, sizeof(theme_file));
theme_settings = gtk_settings_get_default();
// snprintf( glade_path, sizeof(glade_path), "%s/gveejay.reloaded.glade",RELOADED_DATADIR);
if(!home)
{
@@ -5512,24 +5510,12 @@ void find_user_themes(int theme)
return;
}
veejay_memset(data,0,sizeof(data));
veejay_memset(location,0,sizeof(location));
char *dst = location;
if( read( sloppy, data, sizeof(data) ) > 0 )
{
int str_len = strlen( data );
int i;
for( i = 0; i < str_len ; i ++ )
{
if( data[i] == '\0' || data[i] == '\n' ) break;
*dst = data[i];
(*dst)++;
}
}
if( read( sloppy, location, sizeof(location) ) <= 0 )
strcat( location, "Default" );
if( sloppy )
close( sloppy );
close( sloppy );
if( strcmp( location, "Default" ) == 0 )
{
@@ -5541,8 +5527,8 @@ void find_user_themes(int theme)
snprintf(theme_path, sizeof(theme_path), "%s/.veejay/theme/%s", home, location );
snprintf(theme_file, sizeof(theme_file), "%s/gveejay.rc", theme_path );
use_default_theme_ = 0;
veejay_msg(VEEJAY_MSG_INFO, "\tRC-style '%s'", theme_file );
veejay_msg(VEEJAY_MSG_INFO, "\tTheme location: '%s'", theme_path);
veejay_msg(VEEJAY_MSG_INFO, "RC-style '%s'", theme_file );
veejay_msg(VEEJAY_MSG_INFO, "Theme location: '%s'", theme_path);
}
struct dirent **files = NULL;
@@ -5603,10 +5589,7 @@ void find_user_themes(int theme)
theme_list[ k ] = strdup("Default");
for( k = 0; theme_list[k] != NULL ; k ++ )
veejay_msg(VEEJAY_MSG_INFO, "Added Theme #%d %s", k, theme_list[k]);
// veejay_msg(VEEJAY_MSG_INFO, "Loading %s", theme_file );
veejay_msg(VEEJAY_MSG_DEBUG, "Added Theme #%d %s", k, theme_list[k]);
}
void gui_load_theme()
@@ -6496,6 +6479,7 @@ void default_bank_values(int *col, int *row )
nsc = 5;
nsy = 4;
}
if( *col == 0 && *row == 0 )
{
NUM_SAMPLES_PER_COL = nsc;
@@ -6508,6 +6492,8 @@ void default_bank_values(int *col, int *row )
}
NUM_SAMPLES_PER_PAGE = NUM_SAMPLES_PER_COL * NUM_SAMPLES_PER_ROW;
NUM_BANKS = (4096 / NUM_SAMPLES_PER_PAGE );
veejay_msg(VEEJAY_MSG_INFO, "Sample bank layout is %d rows by %d columns", NUM_SAMPLES_PER_ROW,NUM_SAMPLES_PER_COL );
}
void set_skin(int skin, int invert)