changed location of fx toggle in sampe panel, added -P commandline option to start with preview enabled

git-svn-id: svn://code.dyne.org/veejay/trunk@877 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
Niels Elburg
2007-03-27 16:14:46 +00:00
parent 89808f18db
commit ee76c15b95
4 changed files with 74 additions and 55 deletions

View File

@@ -893,45 +893,6 @@
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkCheckButton" id="check_samplefx">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Enable/disable effectchain</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_HALF</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="clicked" handler="on_check_samplefx_clicked" last_modification_time="Sun, 27 Mar 2005 06:12:03 GMT"/>
<child>
<widget class="GtkLabel" id="label268">
<property name="visible">True</property>
<property name="label" translatable="yes">Effect chain enabled</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table79">
<property name="visible">True</property>
@@ -1485,6 +1446,45 @@
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="check_samplefx">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Enable/disable effectchain</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_HALF</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="clicked" handler="on_check_samplefx_clicked" last_modification_time="Sun, 27 Mar 2005 06:12:03 GMT"/>
<child>
<widget class="GtkLabel" id="label268">
<property name="visible">True</property>
<property name="label" translatable="yes">Effect chain enabled</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>

View File

@@ -44,6 +44,7 @@ static int n_tracks = 3;
static int launcher = 0;
static int pw = 176;
static int ph = 144;
static int preview = 0; // off
static struct
{
char *file;
@@ -56,12 +57,13 @@ static void usage(char *progname)
{
printf( "Usage: %s <options>\n",progname);
printf( "where options are:\n");
printf( "-h/--hostname\t\tVeejay host to connect to (defaults to localhost) \n");
printf( "-p/--port\t\tVeejay port to connect to (defaults to 3490) \n");
printf( "-n/--no-theme\t\tDont load gveejay's GTK theme\n");
printf( "-v/--verbose\t\tBe extra verbose (usefull for debugging)\n");
printf( "-s/--size\t\tSet bank resolution (row X columns)\n");
printf( "-X/\t\tSet number of tracks\n");
printf( "-h\t\tVeejay host to connect to (defaults to localhost) \n");
printf( "-p\t\tVeejay port to connect to (defaults to 3490) \n");
printf( "-n\t\tDont load gveejay's GTK theme\n");
printf( "-v\t\tBe extra verbose (usefull for debugging)\n");
printf( "-s\t\tSet bank resolution (row X columns)\n");
printf( "-P\t\tStart with preview enabled (1=1/1,2=1/2,3=1/4,4=1/8)\n");
printf( "-X\t\tSet number of tracks\n");
printf( "\n\n");
exit(-1);
}
@@ -103,6 +105,15 @@ static int set_option( const char *name, char *value )
err++;
}
}
else if (strcmp(name, "P" ) == 0 || strcmp(name, "preview" ) == 0 )
{
preview = atoi(optarg);
if(preview <= 0 || preview > 4 )
{
fprintf(stderr, "--preview [0-4]\n");
err++;
}
}
else
err++;
return err;
@@ -119,7 +130,7 @@ int main(int argc, char *argv[]) {
// default host to connect to
sprintf(hostname, "127.0.0.1");
while( ( n = getopt( argc, argv, "s:h:p:nvHf:X:")) != EOF )
while( ( n = getopt( argc, argv, "s:h:p:nvHf:X:P:")) != EOF )
{
sprintf(option, "%c", n );
err += set_option( option, optarg);
@@ -163,7 +174,11 @@ int main(int argc, char *argv[]) {
else
veejay_msg(VEEJAY_MSG_INFO, "GVeejayReloaded running with low priority");
if( preview )
{
veejay_msg(VEEJAY_MSG_INFO, "Starting with preview enabled");
gveejay_preview(preview);
}
while(gveejay_running())
{

View File

@@ -254,13 +254,7 @@ typedef struct
gint event_id;
} vims_keys_t;
// Have room for only 2 * 120 samples
//#define NUM_BANKS 20
//#define NUM_PAGES 10
//#define NUM_SAMPLES_PER_PAGE 12
//#define NUM_SAMPLES_PER_COL 2
//#define NUM_SAMPLES_PER_ROW 6
static int user_preview = 0;
static int NUM_BANKS = 30;
static int NUM_PAGES = 16;
static int NUM_SAMPLES_PER_PAGE = 12;
@@ -6773,6 +6767,11 @@ void vj_gui_preview(void)
gtk_widget_set_size_request(info->quick_select, image_width, image_height );
}
void gveejay_preview( int p )
{
user_preview = p;
}
int vj_gui_reconnect(char *hostname,char *group_name, int port_num)
{
if(!hostname && !group_name )
@@ -6951,6 +6950,11 @@ gboolean is_alive( void )
veejay_stop_connecting(gui);
multrack_audoadd( info->mt, remote, port );
info->watch.p_state = 0;
if( user_preview )
{
multitrack_set_quality( info->mt, user_preview );
set_toggle_button( "previewtoggle", 1 );
}
}
}

View File

@@ -43,7 +43,7 @@ int vj_get_preview_box_w();
int vj_get_preview_box_h();
int _effect_get_minmax( int effect_id, int *min, int *max, int index );
void vj_gui_cb(int state, char *hostname, int port_num);
void gveejay_preview(int p);
int is_button_toggled(const char *name);
GdkPixbuf *vj_gdk_pixbuf_scale_simple( const GdkPixbuf *src, int dw, int dh, GdkInterpType inter_type );
gchar *_utf8str( const char *c_str );