Change the appearance of the "SM" indicator in mixer, daw, sequencer. Tweak GUIs.
This commit is contained in:
parent
e662a7623b
commit
57ac27ecac
|
@ -20,15 +20,19 @@
|
|||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl.H>
|
||||
|
||||
class Fl_Blinker : public Fl_Button
|
||||
/* Kind of like Fl_Light_Button except that the whole thing is the
|
||||
* indicator and it can optionally blink */
|
||||
|
||||
class Fl_Blink_Button : public Fl_Button
|
||||
{
|
||||
bool _on;
|
||||
float _blink_interval;
|
||||
bool _blinking;
|
||||
|
||||
static void
|
||||
update_cb ( void *v )
|
||||
{
|
||||
((Fl_Blinker*)v)->update_cb();
|
||||
((Fl_Blink_Button*)v)->update_cb();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -48,9 +52,10 @@ public:
|
|||
static const float FAST = 0.1f;
|
||||
static const float DEFAULT = 0.5f;
|
||||
|
||||
Fl_Blinker ( int X, int Y, int W, int H, const char *L )
|
||||
Fl_Blink_Button ( int X, int Y, int W, int H, const char *L )
|
||||
: Fl_Button( X, Y, W, H, L )
|
||||
{
|
||||
_blinking = true;
|
||||
_on = false;
|
||||
|
||||
_blink_interval = DEFAULT;
|
||||
|
@ -59,14 +64,26 @@ public:
|
|||
}
|
||||
|
||||
virtual
|
||||
~Fl_Blinker ()
|
||||
~Fl_Blink_Button ()
|
||||
{
|
||||
if ( value() )
|
||||
Fl::remove_timeout( update_cb, this );
|
||||
}
|
||||
|
||||
void blink ( bool b )
|
||||
{
|
||||
_blinking = b;
|
||||
if ( ! b )
|
||||
_on = true;
|
||||
}
|
||||
|
||||
bool blink ( void ) const
|
||||
{
|
||||
return _blinking;
|
||||
}
|
||||
|
||||
void
|
||||
interval ( float v )
|
||||
blink_interval ( float v )
|
||||
{
|
||||
_blink_interval = v;
|
||||
if ( value() )
|
||||
|
@ -80,7 +97,8 @@ public:
|
|||
{
|
||||
if ( v )
|
||||
{
|
||||
Fl::add_timeout( _blink_interval, update_cb, this );
|
||||
if ( _blinking )
|
||||
Fl::add_timeout( _blink_interval, update_cb, this );
|
||||
Fl_Button::value( v );
|
||||
redraw();
|
||||
}
|
|
@ -47,7 +47,6 @@
|
|||
#include "FL/Fl_Value_SliderX.H"
|
||||
#include "OSC/Endpoint.H"
|
||||
#include <lo/lo.h>
|
||||
#include "FL/Fl_Blinker.H"
|
||||
|
||||
#include "OSC/Endpoint.H"
|
||||
|
||||
|
@ -355,48 +354,54 @@ Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) :
|
|||
_rows = 1;
|
||||
box( FL_NO_BOX );
|
||||
labelsize( 96 );
|
||||
{ Fl_Menu_Bar *o = menubar = new Fl_Menu_Bar( X, Y, W, 24 );
|
||||
o->add( "&Project/&New" );
|
||||
o->add( "&Project/&Open" );
|
||||
o->add( "&Project/&Save", FL_CTRL + 's', 0, 0 );
|
||||
o->add( "&Project/&Quit", FL_CTRL + 'q', 0, 0 );
|
||||
o->add( "&Mixer/&Add Strip", 'a', 0, 0 );
|
||||
o->add( "&Mixer/Add &N Strips" );
|
||||
o->add( "&Mixer/&Import Strip" );
|
||||
o->add( "&Mixer/&Rows/One", '1', 0, 0 );
|
||||
o->add( "&Mixer/&Rows/Two", '2', 0, 0 );
|
||||
o->add( "&Mixer/&Rows/Three", '3', 0, 0 );
|
||||
o->add( "&View/&Theme", 0, 0, 0 );
|
||||
o->add( "_&Options/&Display/&Knobs/&Arc", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Knobs/&Burnished", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Knobs/&Plastic", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
|
||||
o->add( "_&Options/&Display/&Sliders/&Nice", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
|
||||
o->add( "_&Options/&Display/&Sliders/&Fill", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Sliders/&Simple", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Colors/&System", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "&Help/&Manual" );
|
||||
o->add( "&Help/&About" );
|
||||
o->callback( cb_menu, this );
|
||||
{ Fl_Group *o = new Fl_Group( X, Y, W, 24 );
|
||||
|
||||
{ Fl_Menu_Bar *o = menubar = new Fl_Menu_Bar( X, Y, W, 24 );
|
||||
o->add( "&Project/&New" );
|
||||
o->add( "&Project/&Open" );
|
||||
o->add( "&Project/&Save", FL_CTRL + 's', 0, 0 );
|
||||
o->add( "&Project/&Quit", FL_CTRL + 'q', 0, 0 );
|
||||
o->add( "&Mixer/&Add Strip", 'a', 0, 0 );
|
||||
o->add( "&Mixer/Add &N Strips" );
|
||||
o->add( "&Mixer/&Import Strip" );
|
||||
o->add( "&Mixer/&Rows/One", '1', 0, 0 );
|
||||
o->add( "&Mixer/&Rows/Two", '2', 0, 0 );
|
||||
o->add( "&Mixer/&Rows/Three", '3', 0, 0 );
|
||||
o->add( "&View/&Theme", 0, 0, 0 );
|
||||
o->add( "_&Options/&Display/&Knobs/&Arc", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Knobs/&Burnished", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Knobs/&Plastic", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
|
||||
o->add( "_&Options/&Display/&Sliders/&Nice", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
|
||||
o->add( "_&Options/&Display/&Sliders/&Fill", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Sliders/&Simple", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "_&Options/&Display/&Colors/&System", 0, 0, 0, FL_MENU_RADIO );
|
||||
o->add( "&Help/&Manual" );
|
||||
o->add( "&Help/&About" );
|
||||
o->callback( cb_menu, this );
|
||||
}
|
||||
{ Fl_Box *o = project_name = new Fl_Box( X + 150, Y, W, 24 );
|
||||
o->labelfont( FL_HELVETICA_ITALIC );
|
||||
o->label( 0 );
|
||||
o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
|
||||
o->labeltype( FL_SHADOW_LABEL );
|
||||
Fl_Group::current()->resizable( o );
|
||||
}
|
||||
{ sm_blinker = new Fl_Button( ( X + W) - 37, Y + 4, 35, 15, "SM");
|
||||
sm_blinker->box(FL_ROUNDED_BOX);
|
||||
sm_blinker->down_box(FL_ROUNDED_BOX);
|
||||
sm_blinker->color(FL_DARK2);
|
||||
sm_blinker->selection_color((Fl_Color)93);
|
||||
sm_blinker->labeltype(FL_NORMAL_LABEL);
|
||||
sm_blinker->labelfont(3);
|
||||
sm_blinker->labelsize(14);
|
||||
sm_blinker->labelcolor(FL_DARK3);
|
||||
sm_blinker->align(Fl_Align(FL_ALIGN_CENTER));
|
||||
sm_blinker->when(FL_WHEN_RELEASE);
|
||||
sm_blinker->deactivate();
|
||||
|
||||
} // Fl_Blink_Button* sm_blinker
|
||||
o->end();
|
||||
}
|
||||
{ Fl_Box *o = project_name = new Fl_Box( X + 150, Y, W, 24 );
|
||||
o->labelfont( FL_HELVETICA_ITALIC );
|
||||
o->label( 0 );
|
||||
o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
|
||||
o->labeltype( FL_SHADOW_LABEL );
|
||||
}
|
||||
{ sm_blinker = new Fl_Blinker( ( X + W) - 52, Y + 4, 50, 15, "SM");
|
||||
sm_blinker->box(FL_ROUNDED_BOX);
|
||||
sm_blinker->down_box(FL_ROUNDED_BOX);
|
||||
sm_blinker->color((Fl_Color)75);
|
||||
sm_blinker->selection_color((Fl_Color)86);
|
||||
sm_blinker->labeltype(FL_NORMAL_LABEL);
|
||||
sm_blinker->labelfont(2);
|
||||
sm_blinker->labelsize(14);
|
||||
sm_blinker->labelcolor(FL_DARK3);
|
||||
sm_blinker->align(Fl_Align(FL_ALIGN_CENTER));
|
||||
sm_blinker->when(FL_WHEN_RELEASE);
|
||||
sm_blinker->deactivate();
|
||||
} // Fl_Blinker* sm_blinker
|
||||
{ Fl_Scroll *o = scroll = new Fl_Scroll( X, Y + 24, W, H - 24 );
|
||||
o->box( FL_NO_BOX );
|
||||
// o->type( Fl_Scroll::HORIZONTAL_ALWAYS );
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "Thread.H"
|
||||
|
||||
class Fl_Blinker;
|
||||
class Fl_Blink_Button;
|
||||
class Fl_Flowpack;
|
||||
class Fl_Menu_Bar;
|
||||
namespace OSC { class Endpoint; }
|
||||
|
@ -40,7 +40,7 @@ class Mixer : public Fl_Group
|
|||
public:
|
||||
|
||||
OSC::Endpoint *osc_endpoint;
|
||||
Fl_Blinker *sm_blinker;
|
||||
Fl_Button *sm_blinker;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -131,12 +131,12 @@ NSM_Client::command_active ( bool b )
|
|||
{
|
||||
if ( b )
|
||||
{
|
||||
ui->sm_indicator->activate();
|
||||
ui->sm_indicator->value( 1 );
|
||||
ui->sm_indicator->tooltip( session_manager_name() );
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->sm_indicator->tooltip( NULL );
|
||||
ui->sm_indicator->deactivate();
|
||||
ui->sm_indicator->value( 0 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,261 +225,12 @@ if ( maybe_save_song() )
|
|||
xywh {798 131 865 805} type Double color 47 resizable
|
||||
code0 {o->color( FL_BACKGROUND_COLOR );} xclass non size_range {700 509 0 0} visible
|
||||
} {
|
||||
Fl_Menu_Bar menu_bar {open
|
||||
xywh {0 0 865 30} color 47
|
||||
} {
|
||||
Submenu {} {
|
||||
label {&File} open
|
||||
xywh {0 0 100 20} color 37
|
||||
} {
|
||||
MenuItem menu_new {
|
||||
label {&New}
|
||||
callback {if ( maybe_save_song() )
|
||||
{
|
||||
init_song();
|
||||
|
||||
// Sync the GUI.
|
||||
update_pattern_widgets();
|
||||
update_sequence_widgets();
|
||||
update_phrase_widgets();
|
||||
|
||||
|
||||
gui_status( "New song." );
|
||||
}}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem menu_open {
|
||||
label {&Open}
|
||||
callback {char *name = fl_file_chooser( "Open File", "Non Files (*.non)", NULL, 0 );
|
||||
|
||||
if ( name )
|
||||
{
|
||||
if ( ! load_song( name ) )
|
||||
fl_alert( "Could not load song!" );
|
||||
else
|
||||
gui_status( "Song opened." );
|
||||
|
||||
update_sequence_widgets();
|
||||
update_pattern_widgets();
|
||||
update_phrase_widgets();
|
||||
|
||||
playback_mode_menu->value( song.play_mode );
|
||||
playback_mode_menu->redraw();
|
||||
}}
|
||||
xywh {0 0 40 25} shortcut 0x4006f color 37
|
||||
}
|
||||
MenuItem menu_save {
|
||||
label {&Save}
|
||||
callback {save_dialog( song.filename );}
|
||||
xywh {0 0 40 25} shortcut 0x40073 color 37 deactivate
|
||||
code0 {song.signal_dirty.connect( sigc::mem_fun( o, &Fl_Menu_Item::activate ) );}
|
||||
code1 {song.signal_clean.connect( sigc::mem_fun( o, &Fl_Menu_Item::deactivate ) );}
|
||||
}
|
||||
MenuItem menu_save_as {
|
||||
label {Save &As}
|
||||
callback {save_dialog( NULL );}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Import}
|
||||
callback {char *name = fl_file_chooser( "MIDI Import", "MIDI Files (*.mid)", NULL, 0 );
|
||||
|
||||
if ( ! name )
|
||||
return;
|
||||
|
||||
smf f;
|
||||
|
||||
if ( ! f.open( name, smf::READ ) )
|
||||
{
|
||||
fl_message( "could not open file" );
|
||||
return;
|
||||
}
|
||||
|
||||
f.read_header();
|
||||
|
||||
switch ( f.format() )
|
||||
{
|
||||
case 0:
|
||||
if ( ! pattern::import( &f, 0 ) )
|
||||
fl_message( "Error importing MIDI" );
|
||||
break;
|
||||
case 1: case 2:
|
||||
{
|
||||
char **sa = f.track_listing();
|
||||
|
||||
if ( sa && *sa )
|
||||
{
|
||||
List_Chooser tc( "Select tracks to import:", "Import" );
|
||||
|
||||
char *s;
|
||||
for ( int i = 0; (s = sa[i]); ++i )
|
||||
{
|
||||
tc.add( s );
|
||||
free( s );
|
||||
}
|
||||
|
||||
free( sa );
|
||||
|
||||
tc.show();
|
||||
|
||||
while( tc.shown() )
|
||||
Fl::wait();
|
||||
|
||||
int n = 0;
|
||||
for ( int i = 1; i <= tc.browser->size(); ++i )
|
||||
{
|
||||
if ( tc.browser->selected( i ) )
|
||||
{
|
||||
if ( pattern::import( &f , i - 1 ) )
|
||||
++n;
|
||||
else
|
||||
WARNING( "error importing track %d", i - 1 );
|
||||
}
|
||||
|
||||
}
|
||||
// fl_message( "%d patterns imported.", n );
|
||||
gui_status( "Imported %d tracks as patterns", n );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}}
|
||||
xywh {0 0 40 25}
|
||||
code0 {\#include "../smf.H"}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Export}
|
||||
callback {// Fl_File_Chooser::custom_filter_label = "*.mid";
|
||||
|
||||
Fl_File_Chooser *fc = new Fl_File_Chooser( ".", "MIDI Files (*.mid)", Fl_File_Chooser::CREATE, "MIDI Export" );
|
||||
|
||||
fc->show();
|
||||
|
||||
// wait for user to make a choice
|
||||
while( fc->shown() )
|
||||
Fl::wait();
|
||||
|
||||
if ( ! fc->value() )
|
||||
return;
|
||||
|
||||
if ( tabs->value() == pattern_tab )
|
||||
((pattern*)pattern_c->grid())->save( fc->value() );}
|
||||
xywh {0 0 40 25}
|
||||
code0 {\#include <FL/Fl_File_Chooser.H>}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Quit}
|
||||
callback {main_window->do_callback();}
|
||||
xywh {0 0 40 25} shortcut 0x40071 color 37
|
||||
}
|
||||
}
|
||||
Submenu edit_menu {
|
||||
label {&Edit} open
|
||||
xywh {0 0 74 25} color 37
|
||||
} {
|
||||
MenuItem {} {
|
||||
label {&Events}
|
||||
callback {event_editor( pattern_c->grid() );}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Randomization Settings}
|
||||
callback {randomization_dialog->show();}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
}
|
||||
Submenu {} {
|
||||
label {&View} open
|
||||
xywh {10 10 74 25} color 37
|
||||
} {
|
||||
MenuItem {} {
|
||||
label {&Metronome}
|
||||
callback {int val = o->menu()[ o->value() ].value();
|
||||
|
||||
if ( val )
|
||||
vmetro_widget->show();
|
||||
else
|
||||
vmetro_widget->hide();}
|
||||
xywh {0 0 40 25} type Toggle value 1
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Compacted}
|
||||
callback {int val = o->menu()[ o->value() ].value();
|
||||
|
||||
pattern_c->row_compact( val ? Canvas::ON : Canvas::OFF );
|
||||
|
||||
pattern_canvas_widget->redraw();}
|
||||
xywh {10 10 40 25} type Toggle value 1
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Follow Playhead}
|
||||
callback {int val = o->menu()[ o->value() ].value();
|
||||
|
||||
config.follow_playhead = val ? true : false;}
|
||||
xywh {10 10 40 25} type Toggle value 1
|
||||
}
|
||||
Submenu {} {
|
||||
label {Note Shape} open
|
||||
xywh {0 0 74 24}
|
||||
} {
|
||||
MenuItem {} {
|
||||
label Circle
|
||||
callback {pattern::note_shape = CIRCLE;
|
||||
pattern_canvas_widget->redraw();}
|
||||
xywh {0 0 40 24} type Radio
|
||||
}
|
||||
MenuItem {} {
|
||||
label Square
|
||||
callback {pattern::note_shape = SQUARE;
|
||||
pattern_canvas_widget->redraw();}
|
||||
xywh {0 0 40 24} type Radio value 1
|
||||
}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Theme}
|
||||
callback {fl_theme_chooser();}
|
||||
xywh {0 0 40 24}
|
||||
}
|
||||
}
|
||||
Submenu {} {
|
||||
label {&Help} open
|
||||
xywh {100 0 74 25} color 37
|
||||
} {
|
||||
MenuItem {} {
|
||||
label {&Keys}
|
||||
callback {show_help_dialog( "KEYS" );}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Manual}
|
||||
callback {show_help_dialog( "MANUAL" );}
|
||||
xywh {10 10 40 25} divider
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&About}
|
||||
callback {About_Dialog ab( PIXMAP_PATH "/non-sequencer/icon-256x256.png" );
|
||||
|
||||
ab.logo_box->label( VERSION );
|
||||
|
||||
ab.title->label( "The Non Sequencer" );
|
||||
|
||||
ab.copyright->label( "Copyright (C) 2007-2012 Jonathan Moore Liles" );
|
||||
ab.credits->label( "Non-Sequencer was written from scratch by\\nJonathan Moore Liles for his own use\\n(see the manual).\\n\\nNobody planned. Nobody helped.\\nYou can help now by donating time, money,\\nand/or replacing the rest of Linux Audio\\nwith fast, light, reliable alternatives.\\n" );
|
||||
|
||||
ab.website_url->label( "http://non-sequencer.tuxfamily.org" );
|
||||
|
||||
ab.run();}
|
||||
xywh {0 0 40 25} color 37
|
||||
code0 {\#include "../non.H"}
|
||||
}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {open
|
||||
xywh {0 30 865 70}
|
||||
} {
|
||||
Fl_Pack {} {
|
||||
label Meter open
|
||||
xywh {220 68 175 27} type HORIZONTAL labeltype NO_LABEL labelsize 9 align 0
|
||||
xywh {214 72 175 25} type HORIZONTAL labeltype NO_LABEL labelsize 9 align 0
|
||||
code0 {o->spacing( 3 );}
|
||||
} {
|
||||
Fl_Box {} {
|
||||
|
@ -516,15 +267,15 @@ ab.run();}
|
|||
code1 {o->box( FL_NO_BOX );}
|
||||
class Visual_Metronome
|
||||
} {}
|
||||
Fl_Pack transport_controls_group {open
|
||||
xywh {10 32 152 42} type HORIZONTAL
|
||||
Fl_Pack transport_controls_group {open selected
|
||||
xywh {4 32 160 44} type HORIZONTAL
|
||||
code0 {o->spacing( 2 );}
|
||||
class Fl_Scalepack
|
||||
} {
|
||||
Fl_Button play_button {
|
||||
label {@>}
|
||||
callback {transport.toggle();}
|
||||
xywh {10 34 43 3} shortcut 0x20 labeltype ENGRAVED_LABEL
|
||||
xywh {10 34 43 40} shortcut 0x20 labeltype ENGRAVED_LABEL
|
||||
}
|
||||
Fl_Button rec_button {
|
||||
label {@circle}
|
||||
|
@ -551,12 +302,12 @@ else
|
|||
|
||||
o->labelcolor( FL_WHITE );
|
||||
}}
|
||||
xywh {60 34 43 3} type Toggle shortcut 0x80072 selection_color 47 labeltype ENGRAVED_LABEL when 1
|
||||
xywh {60 34 43 40} type Toggle shortcut 0x80072 selection_color 47 labeltype ENGRAVED_LABEL when 1
|
||||
}
|
||||
Fl_Button home_button {
|
||||
label {@|<}
|
||||
callback {transport.locate( 0 );}
|
||||
xywh {110 34 43 3} shortcut 0xff50 labeltype ENGRAVED_LABEL
|
||||
xywh {110 34 43 40} shortcut 0xff50 labeltype ENGRAVED_LABEL
|
||||
}
|
||||
}
|
||||
Fl_Choice record_mode_menu {
|
||||
|
@ -565,7 +316,7 @@ else
|
|||
config.record_mode = (record_mode_e)o->value();
|
||||
else
|
||||
o->value( config.record_mode );} open
|
||||
xywh {171 41 100 27} box PLASTIC_DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1
|
||||
xywh {171 41 100 27} box DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1
|
||||
} {
|
||||
MenuItem {} {
|
||||
label Merge
|
||||
|
@ -586,7 +337,7 @@ else
|
|||
}
|
||||
Fl_Choice playback_mode_menu {
|
||||
label {Playback &Mode} open
|
||||
xywh {285 41 100 26} box PLASTIC_DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1
|
||||
xywh {285 41 100 26} box DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1
|
||||
} {
|
||||
MenuItem {} {
|
||||
label Pattern
|
||||
|
@ -632,12 +383,12 @@ else
|
|||
}
|
||||
|
||||
menu_bar->redraw();} open
|
||||
xywh {0 76 865 701} color 37 labeltype SHADOW_LABEL labelsize 19 when 1 resizable
|
||||
xywh {0 79 865 698} color 37 labeltype SHADOW_LABEL labelsize 19 when 1 resizable
|
||||
code0 {canvas_background_color = fl_rgb_color( 18, 18, 18 );}
|
||||
} {
|
||||
Fl_Group sequence_tab {
|
||||
label Sequence open
|
||||
xywh {0 98 862 674} color 37 hide resizable
|
||||
xywh {0 102 865 674} color 37 hide resizable
|
||||
code0 {update_sequence_widgets();}
|
||||
} {
|
||||
Fl_Group {} {open
|
||||
|
@ -765,19 +516,19 @@ if ( playlist->length() )
|
|||
}
|
||||
Fl_Group phrase_tab {
|
||||
label Phrase open
|
||||
xywh {0 98 865 674} color 47 hide
|
||||
xywh {0 102 865 674} color 47
|
||||
code0 {update_phrase_widgets();}
|
||||
} {
|
||||
Fl_Box phrase_canvas_widget {
|
||||
label Phrase
|
||||
xywh {4 102 860 590} box FLAT_BOX color 37 labelsize 100 align 16 resizable
|
||||
xywh {1 103 863 587} box FLAT_BOX color 37 labelsize 100 align 16 resizable
|
||||
code0 {o->set_canvas( phrase_c );
|
||||
phrase_c->signal_pan.connect( sigc::mem_fun( phrase_canvas_widget, &O_Canvas::handle_pan ) );}
|
||||
code1 {o->box( FL_NO_BOX );}
|
||||
class O_Canvas
|
||||
}
|
||||
Fl_Group {} {open
|
||||
xywh {5 697 859 72}
|
||||
xywh {5 697 856 72}
|
||||
} {
|
||||
Fl_Input phrase_name_field {
|
||||
label {name:}
|
||||
|
@ -816,13 +567,13 @@ o->maximum( phrase::phrases() );}
|
|||
}
|
||||
}
|
||||
Fl_Group pattern_tab {
|
||||
label Pattern open selected
|
||||
xywh {0 98 865 674} color 47
|
||||
label Pattern open
|
||||
xywh {0 102 865 674} color 47 hide
|
||||
code0 {update_pattern_widgets();}
|
||||
} {
|
||||
Fl_Box pattern_canvas_widget {
|
||||
label Pattern
|
||||
xywh {4 102 860 590} box FLAT_BOX color 37 labelsize 100 align 16 resizable
|
||||
xywh {1 103 863 587} box FLAT_BOX color 37 labelsize 100 align 16 resizable
|
||||
code0 {\#include "draw.H"}
|
||||
code1 {o->set_canvas( pattern_c );
|
||||
pattern_c->signal_pan.connect( sigc::mem_fun( pattern_canvas_widget, &O_Canvas::handle_pan ) );}
|
||||
|
@ -830,7 +581,7 @@ o->maximum( phrase::phrases() );}
|
|||
class O_Canvas
|
||||
}
|
||||
Fl_Group {} {open
|
||||
xywh {0 694 865 78} color 47
|
||||
xywh {0 694 862 78} color 47
|
||||
} {
|
||||
Fl_Input pattern_name_field {
|
||||
label {name:}
|
||||
|
@ -1140,9 +891,266 @@ if ( s != o->label() )
|
|||
xywh {460 692 30 18} hide
|
||||
}
|
||||
}
|
||||
Fl_Box sm_indicator {
|
||||
label SM
|
||||
xywh {810 7 50 13} box ROUNDED_BOX color 50 labelcolor 3 deactivate
|
||||
Fl_Group {} {open
|
||||
xywh {0 0 865 31}
|
||||
} {
|
||||
Fl_Menu_Bar menu_bar {open
|
||||
xywh {0 0 865 30} color 47
|
||||
} {
|
||||
Submenu {} {
|
||||
label {&File} open
|
||||
xywh {0 0 100 20} color 37
|
||||
} {
|
||||
MenuItem menu_new {
|
||||
label {&New}
|
||||
callback {if ( maybe_save_song() )
|
||||
{
|
||||
init_song();
|
||||
|
||||
// Sync the GUI.
|
||||
update_pattern_widgets();
|
||||
update_sequence_widgets();
|
||||
update_phrase_widgets();
|
||||
|
||||
|
||||
gui_status( "New song." );
|
||||
}}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem menu_open {
|
||||
label {&Open}
|
||||
callback {char *name = fl_file_chooser( "Open File", "Non Files (*.non)", NULL, 0 );
|
||||
|
||||
if ( name )
|
||||
{
|
||||
if ( ! load_song( name ) )
|
||||
fl_alert( "Could not load song!" );
|
||||
else
|
||||
gui_status( "Song opened." );
|
||||
|
||||
update_sequence_widgets();
|
||||
update_pattern_widgets();
|
||||
update_phrase_widgets();
|
||||
|
||||
playback_mode_menu->value( song.play_mode );
|
||||
playback_mode_menu->redraw();
|
||||
}}
|
||||
xywh {0 0 40 25} shortcut 0x4006f color 37
|
||||
}
|
||||
MenuItem menu_save {
|
||||
label {&Save}
|
||||
callback {save_dialog( song.filename );}
|
||||
xywh {0 0 40 25} shortcut 0x40073 color 37 deactivate
|
||||
code0 {song.signal_dirty.connect( sigc::mem_fun( o, &Fl_Menu_Item::activate ) );}
|
||||
code1 {song.signal_clean.connect( sigc::mem_fun( o, &Fl_Menu_Item::deactivate ) );}
|
||||
}
|
||||
MenuItem menu_save_as {
|
||||
label {Save &As}
|
||||
callback {save_dialog( NULL );}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Import}
|
||||
callback {char *name = fl_file_chooser( "MIDI Import", "MIDI Files (*.mid)", NULL, 0 );
|
||||
|
||||
if ( ! name )
|
||||
return;
|
||||
|
||||
smf f;
|
||||
|
||||
if ( ! f.open( name, smf::READ ) )
|
||||
{
|
||||
fl_message( "could not open file" );
|
||||
return;
|
||||
}
|
||||
|
||||
f.read_header();
|
||||
|
||||
switch ( f.format() )
|
||||
{
|
||||
case 0:
|
||||
if ( ! pattern::import( &f, 0 ) )
|
||||
fl_message( "Error importing MIDI" );
|
||||
break;
|
||||
case 1: case 2:
|
||||
{
|
||||
char **sa = f.track_listing();
|
||||
|
||||
if ( sa && *sa )
|
||||
{
|
||||
List_Chooser tc( "Select tracks to import:", "Import" );
|
||||
|
||||
char *s;
|
||||
for ( int i = 0; (s = sa[i]); ++i )
|
||||
{
|
||||
tc.add( s );
|
||||
free( s );
|
||||
}
|
||||
|
||||
free( sa );
|
||||
|
||||
tc.show();
|
||||
|
||||
while( tc.shown() )
|
||||
Fl::wait();
|
||||
|
||||
int n = 0;
|
||||
for ( int i = 1; i <= tc.browser->size(); ++i )
|
||||
{
|
||||
if ( tc.browser->selected( i ) )
|
||||
{
|
||||
if ( pattern::import( &f , i - 1 ) )
|
||||
++n;
|
||||
else
|
||||
WARNING( "error importing track %d", i - 1 );
|
||||
}
|
||||
|
||||
}
|
||||
// fl_message( "%d patterns imported.", n );
|
||||
gui_status( "Imported %d tracks as patterns", n );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}}
|
||||
xywh {0 0 40 25}
|
||||
code0 {\#include "../smf.H"}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Export}
|
||||
callback {// Fl_File_Chooser::custom_filter_label = "*.mid";
|
||||
|
||||
Fl_File_Chooser *fc = new Fl_File_Chooser( ".", "MIDI Files (*.mid)", Fl_File_Chooser::CREATE, "MIDI Export" );
|
||||
|
||||
fc->show();
|
||||
|
||||
// wait for user to make a choice
|
||||
while( fc->shown() )
|
||||
Fl::wait();
|
||||
|
||||
if ( ! fc->value() )
|
||||
return;
|
||||
|
||||
if ( tabs->value() == pattern_tab )
|
||||
((pattern*)pattern_c->grid())->save( fc->value() );}
|
||||
xywh {0 0 40 25}
|
||||
code0 {\#include <FL/Fl_File_Chooser.H>}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Quit}
|
||||
callback {main_window->do_callback();}
|
||||
xywh {0 0 40 25} shortcut 0x40071 color 37
|
||||
}
|
||||
}
|
||||
Submenu edit_menu {
|
||||
label {&Edit} open
|
||||
xywh {0 0 74 25} color 37
|
||||
} {
|
||||
MenuItem {} {
|
||||
label {&Events}
|
||||
callback {event_editor( pattern_c->grid() );}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Randomization Settings}
|
||||
callback {randomization_dialog->show();}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
}
|
||||
Submenu {} {
|
||||
label {&View} open
|
||||
xywh {10 10 74 25} color 37
|
||||
} {
|
||||
MenuItem {} {
|
||||
label {&Metronome}
|
||||
callback {int val = o->menu()[ o->value() ].value();
|
||||
|
||||
if ( val )
|
||||
vmetro_widget->show();
|
||||
else
|
||||
vmetro_widget->hide();}
|
||||
xywh {0 0 40 25} type Toggle value 1
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Compacted}
|
||||
callback {int val = o->menu()[ o->value() ].value();
|
||||
|
||||
pattern_c->row_compact( val ? Canvas::ON : Canvas::OFF );
|
||||
|
||||
pattern_canvas_widget->redraw();}
|
||||
xywh {10 10 40 25} type Toggle value 1
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Follow Playhead}
|
||||
callback {int val = o->menu()[ o->value() ].value();
|
||||
|
||||
config.follow_playhead = val ? true : false;}
|
||||
xywh {10 10 40 25} type Toggle value 1
|
||||
}
|
||||
Submenu {} {
|
||||
label {Note Shape} open
|
||||
xywh {0 0 74 24}
|
||||
} {
|
||||
MenuItem {} {
|
||||
label Circle
|
||||
callback {pattern::note_shape = CIRCLE;
|
||||
pattern_canvas_widget->redraw();}
|
||||
xywh {0 0 40 24} type Radio
|
||||
}
|
||||
MenuItem {} {
|
||||
label Square
|
||||
callback {pattern::note_shape = SQUARE;
|
||||
pattern_canvas_widget->redraw();}
|
||||
xywh {0 0 40 24} type Radio value 1
|
||||
}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Theme}
|
||||
callback {fl_theme_chooser();}
|
||||
xywh {0 0 40 24}
|
||||
}
|
||||
}
|
||||
Submenu {} {
|
||||
label {&Help} open
|
||||
xywh {100 0 74 25} color 37
|
||||
} {
|
||||
MenuItem {} {
|
||||
label {&Keys}
|
||||
callback {show_help_dialog( "KEYS" );}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&Manual}
|
||||
callback {show_help_dialog( "MANUAL" );}
|
||||
xywh {10 10 40 25} divider
|
||||
}
|
||||
MenuItem {} {
|
||||
label {&About}
|
||||
callback {About_Dialog ab( PIXMAP_PATH "/non-sequencer/icon-256x256.png" );
|
||||
|
||||
ab.logo_box->label( VERSION );
|
||||
|
||||
ab.title->label( "The Non Sequencer" );
|
||||
|
||||
ab.copyright->label( "Copyright (C) 2007-2012 Jonathan Moore Liles" );
|
||||
ab.credits->label( "Non-Sequencer was written from scratch by\\nJonathan Moore Liles for his own use\\n(see the manual).\\n\\nNobody planned. Nobody helped.\\nYou can help now by donating time, money,\\nand/or replacing the rest of Linux Audio\\nwith fast, light, reliable alternatives.\\n" );
|
||||
|
||||
ab.website_url->label( "http://non-sequencer.tuxfamily.org" );
|
||||
|
||||
ab.run();}
|
||||
xywh {0 0 40 25} color 37
|
||||
code0 {\#include "../non.H"}
|
||||
}
|
||||
}
|
||||
}
|
||||
Fl_Button sm_indicator {
|
||||
label SM
|
||||
xywh {825 8 35 15} box ROUNDED_BOX down_box ROUNDED_BOX color 46 selection_color 93 labelfont 3 labelcolor 39 deactivate
|
||||
}
|
||||
Fl_Box {} {
|
||||
label label
|
||||
xywh {15 15 35 16} hide resizable
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,9 @@ comment {//
|
|||
decl {const float STATUS_UPDATE_FREQ = 0.5f;} {private local
|
||||
}
|
||||
|
||||
decl {class Fl_Flowpack;} {public global
|
||||
}
|
||||
|
||||
decl {\#include "Fl_Menu_Settings.H"} {private local
|
||||
}
|
||||
|
||||
|
@ -43,6 +46,9 @@ decl {\#include "Project.H"} {private local
|
|||
decl {\#include "Clock.H"} {public local
|
||||
}
|
||||
|
||||
decl {\#include "FL/Fl_Flowpack.H"} {private local
|
||||
}
|
||||
|
||||
decl {\#include "New_Project_Dialog.H"} {private local
|
||||
}
|
||||
|
||||
|
@ -224,10 +230,10 @@ Loggable::progress_callback( &TLE::progress_cb, this );} {}
|
|||
label {Non DAW : Timeline}
|
||||
callback {if ( Fl::event_key() != FL_Escape )
|
||||
timeline->command_quit();} open
|
||||
xywh {705 125 1025 770} type Double resizable xclass Non_DAW visible
|
||||
xywh {485 131 1025 770} type Double resizable xclass Non_DAW size_range {900 300 0 0} visible
|
||||
} {
|
||||
Fl_Menu_Bar menubar {open
|
||||
private xywh {0 0 1024 25}
|
||||
private xywh {0 0 1025 25}
|
||||
} {
|
||||
Submenu {} {
|
||||
label {&Project} open
|
||||
|
@ -451,7 +457,7 @@ Project::compact();}
|
|||
}
|
||||
MenuItem {} {
|
||||
label {&Theme}
|
||||
callback {fl_theme_chooser();} selected
|
||||
callback {fl_theme_chooser();}
|
||||
xywh {10 10 40 24}
|
||||
code0 {\#include "FL/Fl_Theme_Chooser.H"}
|
||||
}
|
||||
|
@ -590,33 +596,34 @@ ab.run();}
|
|||
}
|
||||
}
|
||||
Fl_Group {} {open
|
||||
xywh {0 1 1025 73}
|
||||
xywh {0 -1 1025 76}
|
||||
} {
|
||||
Fl_Pack {} {open
|
||||
xywh {5 29 475 40} type HORIZONTAL
|
||||
xywh {3 27 477 44} type HORIZONTAL
|
||||
code0 {o->spacing( 10 );}
|
||||
} {
|
||||
Fl_Box {} {
|
||||
label {<Transport>}
|
||||
xywh {5 29 189 40} color 30
|
||||
xywh {5 29 185 37} color 30
|
||||
code0 {transport = o;}
|
||||
code1 {o->labeltype( FL_NO_LABEL );}
|
||||
code2 {o->spacing( 1 );}
|
||||
class Transport
|
||||
}
|
||||
Fl_Pack clocks_pack {open
|
||||
private xywh {195 29 285 40} type HORIZONTAL
|
||||
private xywh {195 27 285 44} type HORIZONTAL
|
||||
code0 {o->spacing( 2 );}
|
||||
} {
|
||||
Fl_Box {} {
|
||||
label PLAYHEAD
|
||||
private xywh {196 29 137 40} box BORDER_BOX color 40
|
||||
private xywh {196 27 137 40} box BORDER_BOX color 40
|
||||
code0 {o->type( Clock::HMS );}
|
||||
code1 {o->run( &transport->frame );}
|
||||
class Clock
|
||||
}
|
||||
Fl_Box {} {
|
||||
label PLAYHEAD
|
||||
xywh {335 29 142 40} box BORDER_BOX color 40
|
||||
xywh {335 31 137 37} box BORDER_BOX color 40
|
||||
code0 {o->type( Clock::BBT );}
|
||||
code1 {o->run( &transport->frame );}
|
||||
class Clock
|
||||
|
@ -625,79 +632,84 @@ ab.run();}
|
|||
}
|
||||
Fl_Box {} {
|
||||
label {<empty>}
|
||||
xywh {480 27 210 42} resizable
|
||||
xywh {475 31 265 40} resizable
|
||||
code0 {o->labeltype( FL_NO_LABEL );}
|
||||
}
|
||||
Fl_Group {} {open
|
||||
xywh {810 26 215 44}
|
||||
xywh {850 22 175 50}
|
||||
} {
|
||||
Fl_Box {} {
|
||||
label {capture:}
|
||||
xywh {865 26 56 14} labelsize 10 align 24
|
||||
xywh {910 26 56 14} labelsize 10 align 24
|
||||
}
|
||||
Fl_Box {} {
|
||||
label {playback:}
|
||||
xywh {865 42 56 14} labelsize 10 align 24
|
||||
xywh {910 42 56 14} labelsize 10 align 24
|
||||
}
|
||||
Fl_Box {} {
|
||||
label {DSP:}
|
||||
xywh {865 56 56 14} labelsize 10 align 24
|
||||
}
|
||||
Fl_Progress capture_buffer_progress {
|
||||
label {50%}
|
||||
private xywh {921 26 104 14} labelsize 10
|
||||
}
|
||||
Fl_Progress cpu_load_progress {
|
||||
label {50%}
|
||||
private xywh {921 56 104 14} labelsize 9
|
||||
}
|
||||
Fl_Progress playback_buffer_progress {
|
||||
label {50%}
|
||||
private xywh {921 41 104 14} labelsize 10
|
||||
xywh {910 56 56 14} labelsize 10 align 24
|
||||
}
|
||||
Fl_Box {} {
|
||||
label filesystem
|
||||
xywh {810 27 55 18} labelsize 10 align 16
|
||||
xywh {855 27 55 18} labelsize 10 align 16
|
||||
}
|
||||
Fl_Progress capture_buffer_progress {
|
||||
label {50%}
|
||||
private xywh {965 26 60 14} labelsize 10
|
||||
}
|
||||
Fl_Progress cpu_load_progress {
|
||||
label {50%}
|
||||
private xywh {965 56 60 14} labelsize 9
|
||||
}
|
||||
Fl_Progress playback_buffer_progress {
|
||||
label {50%}
|
||||
private xywh {965 41 60 14} labelsize 10
|
||||
}
|
||||
Fl_Progress disk_usage_progress {
|
||||
label {50%}
|
||||
private xywh {810 43 55 26} labelsize 10
|
||||
private xywh {855 42 55 28} labelsize 10
|
||||
code0 {o->type( FL_VERTICAL );}
|
||||
}
|
||||
}
|
||||
Fl_Button solo_blinker {
|
||||
label SOLO
|
||||
xywh {750 30 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 74 selection_color 92 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blinker.H"}
|
||||
class Fl_Blinker
|
||||
}
|
||||
Fl_Button rec_blinker {
|
||||
label REC
|
||||
xywh {750 50 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 72 selection_color 88 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blinker.H"}
|
||||
class Fl_Blinker
|
||||
}
|
||||
Fl_Button sm_blinker {
|
||||
label SM
|
||||
xywh {695 30 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 75 selection_color 86 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blinker.H"}
|
||||
class Fl_Blinker
|
||||
}
|
||||
Fl_Button selected_blinker {
|
||||
label SEL
|
||||
xywh {695 50 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 13 selection_color 5 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blinker.H"}
|
||||
class Fl_Blinker
|
||||
}
|
||||
Fl_Button seek_blinker {
|
||||
label SEEK
|
||||
xywh {640 50 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 10 selection_color 2 labelfont 2 labelcolor 39 hide deactivate
|
||||
code0 {\#include "FL/Fl_Blinker.H"}
|
||||
code1 {o->interval( Fl_Blinker::FAST );}
|
||||
class Fl_Blinker
|
||||
Fl_Group {} {open
|
||||
xywh {740 30 115 40}
|
||||
} {
|
||||
Fl_Button solo_blinker {
|
||||
label SOLO
|
||||
xywh {800 32 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 74 selection_color 92 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blink_Button.H"}
|
||||
class Fl_Blink_Button
|
||||
}
|
||||
Fl_Button rec_blinker {
|
||||
label REC
|
||||
xywh {800 52 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 72 selection_color 88 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blink_Button.H"}
|
||||
class Fl_Blink_Button
|
||||
}
|
||||
Fl_Button selected_blinker {
|
||||
label SEL
|
||||
xywh {745 52 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 13 selection_color 5 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blink_Button.H"}
|
||||
code1 {o->blink( false );}
|
||||
class Fl_Blink_Button
|
||||
}
|
||||
Fl_Button seek_blinker {
|
||||
label SEEK selected
|
||||
xywh {745 32 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 10 selection_color 2 labelfont 2 labelcolor 39 deactivate
|
||||
code0 {\#include "FL/Fl_Blink_Button.H"}
|
||||
code1 {o->blink_interval( Fl_Blink_Button::FAST );}
|
||||
class Fl_Blink_Button
|
||||
}
|
||||
}
|
||||
Fl_Box stats_box {
|
||||
label {<stats>}
|
||||
xywh {810 1 215 21} labelsize 13 labelcolor 53 align 88
|
||||
xywh {745 0 235 24} labelsize 13 labelcolor 53 align 88
|
||||
}
|
||||
Fl_Button sm_blinker {
|
||||
label SM
|
||||
xywh {985 5 35 15} box ROUNDED_BOX down_box ROUNDED_BOX color 45 selection_color 93 labelfont 3 labelcolor 39 deactivate
|
||||
class Fl_Button
|
||||
}
|
||||
}
|
||||
Fl_Progress progress {
|
||||
|
@ -706,13 +718,13 @@ ab.run();}
|
|||
}
|
||||
Fl_Box {} {
|
||||
label {<Timeline>}
|
||||
xywh {0 72 1024 695} box FLAT_BOX color 47 labelsize 100 resizable
|
||||
xywh {0 75 1025 692} box FLAT_BOX color 47 labelsize 100 resizable
|
||||
code0 {timeline = o;}
|
||||
class Timeline
|
||||
}
|
||||
Fl_Box project_name {
|
||||
label {<project name>}
|
||||
private xywh {450 0 365 22} labeltype SHADOW_LABEL labelfont 2
|
||||
private xywh {440 0 305 24} labeltype SHADOW_LABEL labelfont 2
|
||||
code0 {o->label( Project::name() );}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue