2009-12-25 01:59:39 +01:00
|
|
|
|
|
|
|
/*******************************************************************************/
|
|
|
|
/* Copyright (C) 2009 Jonathan Moore Liles */
|
|
|
|
/* */
|
|
|
|
/* This program is free software; you can redistribute it and/or modify it */
|
|
|
|
/* under the terms of the GNU General Public License as published by the */
|
|
|
|
/* Free Software Foundation; either version 2 of the License, or (at your */
|
|
|
|
/* option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* This program is distributed in the hope that it will be useful, but WITHOUT */
|
|
|
|
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
|
|
|
|
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
|
|
|
|
/* more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public License along */
|
|
|
|
/* with This program; see the file COPYING. If not,write to the Free Software */
|
|
|
|
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
|
|
/*******************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Fl_Widget.H>
|
|
|
|
#include <FL/Fl_Group.H>
|
|
|
|
#include <FL/Fl_Scroll.H>
|
|
|
|
#include <FL/Fl_Pack.H>
|
|
|
|
#include "Mixer_Strip.H"
|
|
|
|
|
2012-03-14 06:41:54 +01:00
|
|
|
#include "Thread.H"
|
|
|
|
|
2012-04-14 23:11:58 +02:00
|
|
|
class Fl_Blink_Button;
|
2010-01-20 07:54:35 +01:00
|
|
|
class Fl_Flowpack;
|
2010-01-24 03:45:53 +01:00
|
|
|
class Fl_Menu_Bar;
|
2012-02-26 03:01:46 +01:00
|
|
|
namespace OSC { class Endpoint; }
|
|
|
|
#include <lo/lo.h>
|
2010-01-21 01:33:02 +01:00
|
|
|
|
2009-12-25 01:59:39 +01:00
|
|
|
class Mixer : public Fl_Group
|
|
|
|
{
|
|
|
|
|
2010-01-21 01:33:02 +01:00
|
|
|
public:
|
|
|
|
|
|
|
|
OSC::Endpoint *osc_endpoint;
|
2012-04-14 23:11:58 +02:00
|
|
|
Fl_Button *sm_blinker;
|
2010-01-21 01:33:02 +01:00
|
|
|
|
2009-12-25 01:59:39 +01:00
|
|
|
private:
|
2012-03-14 06:41:54 +01:00
|
|
|
|
2010-01-20 07:54:35 +01:00
|
|
|
int _rows;
|
|
|
|
|
2010-01-24 03:45:53 +01:00
|
|
|
Fl_Color system_colors[3];
|
|
|
|
|
2009-12-25 01:59:39 +01:00
|
|
|
Mixer_Strip* track_by_name ( const char *name );
|
|
|
|
|
|
|
|
void snapshot ( void );
|
|
|
|
static void snapshot ( void *v ) { ((Mixer*)v)->snapshot(); }
|
|
|
|
|
2010-01-12 03:31:15 +01:00
|
|
|
void cb_menu(Fl_Widget*);
|
|
|
|
static void cb_menu(Fl_Widget*, void*);
|
|
|
|
|
2010-01-24 03:45:53 +01:00
|
|
|
Fl_Menu_Bar *menubar;
|
2009-12-25 01:59:39 +01:00
|
|
|
Fl_Scroll *scroll;
|
|
|
|
Fl_Pack *pack;
|
2010-02-01 03:54:15 +01:00
|
|
|
Fl_Box *project_name;
|
2010-01-20 07:54:35 +01:00
|
|
|
|
2010-01-22 06:30:16 +01:00
|
|
|
Fl_Flowpack *mixer_strips;
|
2009-12-25 01:59:39 +01:00
|
|
|
|
2010-01-24 03:45:53 +01:00
|
|
|
void load_options ( void );
|
|
|
|
void save_options ( void );
|
2010-01-31 22:02:26 +01:00
|
|
|
void update_menu ( void );
|
2012-03-03 03:02:23 +01:00
|
|
|
|
|
|
|
void redraw_windows ( void );
|
2010-01-24 03:45:53 +01:00
|
|
|
|
2012-03-05 03:02:01 +01:00
|
|
|
static void handle_dirty ( int, void *v );
|
|
|
|
|
2009-12-25 01:59:39 +01:00
|
|
|
protected:
|
|
|
|
|
2010-01-30 09:38:15 +01:00
|
|
|
int handle ( int m );
|
2009-12-25 01:59:39 +01:00
|
|
|
|
|
|
|
public:
|
2010-02-24 16:00:14 +01:00
|
|
|
|
2010-01-31 19:51:55 +01:00
|
|
|
char * get_unique_track_name ( const char *name );
|
|
|
|
|
|
|
|
int min_h ( void ) const { return Mixer_Strip::min_h() + (18 * 2); }
|
2010-01-24 03:45:53 +01:00
|
|
|
|
2010-01-20 07:54:35 +01:00
|
|
|
void rows ( int n );
|
2009-12-25 01:59:39 +01:00
|
|
|
virtual void resize ( int X, int Y, int W, int H );
|
|
|
|
|
|
|
|
void new_strip ( void );
|
|
|
|
void process ( unsigned int nframes );
|
|
|
|
void add ( Mixer_Strip *ms );
|
|
|
|
void remove ( Mixer_Strip *ms );
|
2010-01-12 06:23:40 +01:00
|
|
|
void move_left ( Mixer_Strip *ms );
|
|
|
|
void move_right ( Mixer_Strip *ms );
|
|
|
|
void insert ( Mixer_Strip *ms, Mixer_Strip *before );
|
|
|
|
void insert ( Mixer_Strip *ms, int i );
|
2009-12-25 01:59:39 +01:00
|
|
|
bool contains ( Mixer_Strip *ms );
|
|
|
|
|
2009-12-28 06:25:28 +01:00
|
|
|
bool save ( void );
|
2010-01-12 06:31:02 +01:00
|
|
|
void quit ( void );
|
2009-12-28 06:25:28 +01:00
|
|
|
|
2009-12-25 01:59:39 +01:00
|
|
|
Mixer ( int X, int Y, int W, int H, const char *L );
|
|
|
|
virtual ~Mixer();
|
2010-01-31 21:42:14 +01:00
|
|
|
|
2012-02-20 10:58:46 +01:00
|
|
|
void reply_to_finger ( lo_message msg );
|
|
|
|
|
2010-01-21 01:33:02 +01:00
|
|
|
void announce ( const char *nash_url, const char *process_name );
|
|
|
|
|
|
|
|
int init_osc ( const char* osc_port );
|
2010-01-21 01:33:02 +01:00
|
|
|
|
2010-01-21 01:33:02 +01:00
|
|
|
void sm_active ( bool b );
|
2012-02-08 19:39:03 +01:00
|
|
|
|
2012-02-21 09:48:13 +01:00
|
|
|
void say_hello ( void );
|
|
|
|
|
2012-02-26 03:01:46 +01:00
|
|
|
void discover_peers ( void );
|
|
|
|
|
2010-01-31 21:42:14 +01:00
|
|
|
public:
|
|
|
|
|
|
|
|
bool command_save ( void );
|
|
|
|
bool command_load ( const char *path, const char *display_name = 0 );
|
|
|
|
bool command_new ( const char *path, const char *display_name = 0 );
|
|
|
|
void command_quit ( void );
|
|
|
|
|
|
|
|
void command_add_strip ( void );
|
|
|
|
|
2009-12-25 01:59:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Mixer* mixer;
|