Don't fail if instrument definitions cannot be found. Use C Major as default mapping.
This commit is contained in:
parent
8f3f02d9aa
commit
0af405908d
1
TODO
1
TODO
|
@ -5,6 +5,7 @@
|
|||
|
||||
; General
|
||||
|
||||
* show playback progress on playlist.
|
||||
* per phrase tempo setting? Perhaps a percentage of global tempo?
|
||||
* add channel field to event list widget (but channel bits in pattern
|
||||
event lists are currently meaningless.)
|
||||
|
|
21
canvas.C
21
canvas.C
|
@ -89,24 +89,13 @@ Canvas::handle_event_change ( void )
|
|||
}
|
||||
|
||||
/** change grid to /g/, returns TRUE if new grid size differs from old */
|
||||
bool
|
||||
void
|
||||
Canvas::grid ( Grid *g )
|
||||
{
|
||||
bool r = false;
|
||||
|
||||
if ( m.grid )
|
||||
{
|
||||
}
|
||||
|
||||
m.grid = g;
|
||||
|
||||
if ( ! g )
|
||||
return false;
|
||||
|
||||
if ( m.vp )
|
||||
if ( m.vp->w != g->viewport.w ||
|
||||
m.vp->h != g->viewport.h )
|
||||
r = true;
|
||||
return;
|
||||
|
||||
m.vp = &g->viewport;
|
||||
|
||||
|
@ -114,11 +103,11 @@ Canvas::grid ( Grid *g )
|
|||
DEBUG( "viewport: %s", s );
|
||||
free( s );
|
||||
|
||||
m.mapping_drawn = m.ruler_drawn = false;
|
||||
m.ruler_drawn = false;
|
||||
|
||||
resize_grid();
|
||||
|
||||
_update_row_mapping();
|
||||
changed_mapping();
|
||||
|
||||
m.shape = m.grid->draw_shape();
|
||||
|
||||
|
@ -129,8 +118,6 @@ Canvas::grid ( Grid *g )
|
|||
|
||||
signal_draw();
|
||||
signal_settings_change();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/** keep row compaction tables up-to-date */
|
||||
|
|
2
canvas.H
2
canvas.H
|
@ -124,7 +124,7 @@ public:
|
|||
|
||||
void handle_event_change ( void );
|
||||
void set ( int x, int y );
|
||||
bool grid ( Grid *g );
|
||||
void grid ( Grid *g );
|
||||
void changed_mapping ( void );
|
||||
Grid * grid ( void );
|
||||
void resize ( void );
|
||||
|
|
36
gui/ui.fl
36
gui/ui.fl
|
@ -636,18 +636,18 @@ if ( 0 == strncmp( picked, "Scale", strlen( "Scale" ) ) )
|
|||
pattern_c->changed_mapping();
|
||||
|
||||
pattern_key_combo->activate();
|
||||
}}
|
||||
}} open selected
|
||||
xywh {609 734 30 24} labeltype NO_LABEL
|
||||
code0 {update_mapping_menu();}
|
||||
} {
|
||||
Submenu mapping_instrument_menu {
|
||||
label Instrument open
|
||||
xywh {10 10 74 25}
|
||||
} {}
|
||||
Submenu mapping_scale_menu {
|
||||
label Scale open
|
||||
xywh {25 25 74 25}
|
||||
} {}
|
||||
Submenu mapping_instrument_menu {
|
||||
label Instrument open
|
||||
xywh {10 10 74 25}
|
||||
} {}
|
||||
}
|
||||
Fl_Choice pattern_key_combo {
|
||||
label {&Key}
|
||||
|
@ -1058,8 +1058,7 @@ if ( g->notes() )
|
|||
else
|
||||
pattern_notes_buffer->text( strdup( "" ) );} {}
|
||||
}
|
||||
Function {update_phrase_widgets()} {open
|
||||
} {
|
||||
Function {update_phrase_widgets()} {} {
|
||||
code {phrase *g = (phrase *)phrase_c->grid();
|
||||
|
||||
if ( ! g )
|
||||
|
@ -1075,8 +1074,7 @@ if ( g->notes() )
|
|||
else
|
||||
phrase_notes_buffer->text( strdup( "" ) );} {}
|
||||
}
|
||||
Function {update_sequence_widgets()} {open
|
||||
} {
|
||||
Function {update_sequence_widgets()} {} {
|
||||
code {if ( playlist->notes() )
|
||||
sequence_notes_buffer->text( playlist->notes() );
|
||||
else
|
||||
|
@ -1121,9 +1119,13 @@ o->value( val );
|
|||
|
||||
free( s );} {}
|
||||
}
|
||||
Function {update_mapping_menu()} {} {
|
||||
Function {update_mapping_menu()} {open
|
||||
} {
|
||||
code {char **sa = Instrument::listing();
|
||||
|
||||
if ( sa )
|
||||
{
|
||||
|
||||
for ( int i = 0; sa[i]; i++ )
|
||||
{
|
||||
char pat[512];
|
||||
|
@ -1132,6 +1134,7 @@ for ( int i = 0; sa[i]; i++ )
|
|||
free( sa[i] );
|
||||
}
|
||||
free( sa );
|
||||
}
|
||||
|
||||
sa = Scale::listing();
|
||||
for ( int i = 0; sa[i]; i++ )
|
||||
|
@ -1151,7 +1154,7 @@ free( sa );} {}
|
|||
if ( phrase_c->grid() )
|
||||
ui->update_phrase_widgets();} {}
|
||||
}
|
||||
Function {find_numeric_menu_item( const Fl_Menu_Item *menu, int n )} {open return_type {static int}
|
||||
Function {find_numeric_menu_item( const Fl_Menu_Item *menu, int n )} {return_type {static int}
|
||||
} {
|
||||
code {for ( unsigned int i = 0; menu[i].text; i++ )
|
||||
{
|
||||
|
@ -1161,7 +1164,7 @@ if ( phrase_c->grid() )
|
|||
|
||||
return 0;} {}
|
||||
}
|
||||
Function {save_dialog( const char *name )} {open return_type void
|
||||
Function {save_dialog( const char *name )} {return_type void
|
||||
} {
|
||||
code {if ( ! name )
|
||||
{
|
||||
|
@ -1183,7 +1186,7 @@ return 0;} {}
|
|||
if ( ! save_song( name ) )
|
||||
fl_alert( "Could not save song" );} {}
|
||||
}
|
||||
Function {show_help_dialog( const char *file )} {open return_type void
|
||||
Function {show_help_dialog( const char *file )} {return_type void
|
||||
} {
|
||||
code {char pat[256];
|
||||
|
||||
|
@ -1198,10 +1201,9 @@ help->load( pat );
|
|||
help->show();
|
||||
|
||||
// FIXME: need to delete it somehow.
|
||||
// help->show(1, argv);} {selected
|
||||
// help->show(1, argv);} {}
|
||||
}
|
||||
}
|
||||
Function {maybe_save_song()} {open return_type bool
|
||||
Function {maybe_save_song()} {return_type bool
|
||||
} {
|
||||
code {if ( song.dirty )
|
||||
{
|
||||
|
@ -1222,7 +1224,7 @@ help->show();
|
|||
|
||||
return true;} {}
|
||||
}
|
||||
Function {switch_to_pattern( int n )} {open return_type void
|
||||
Function {switch_to_pattern( int n )} {return_type void
|
||||
} {
|
||||
code {pattern *p = pattern::pattern_by_number( n );
|
||||
|
||||
|
|
Loading…
Reference in New Issue