2 /*******************************************************************************/
3 /* Copyright (C) 2007-2008 Jonathan Moore Liles */
5 /* This program is free software; you can redistribute it and/or modify it */
6 /* under the terms of the GNU General Public License as published by the */
7 /* Free Software Foundation; either version 2 of the License, or (at your */
8 /* option) any later version. */
10 /* This program is distributed in the hope that it will be useful, but WITHOUT */
11 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
12 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
15 /* You should have received a copy of the GNU General Public License along */
16 /* with This program; see the file COPYING. If not,write to the Free Software */
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 /*******************************************************************************/
31 class pattern : public Grid
33 static event_list _recorded_events;
34 static vector <pattern *> _patterns;
36 static int _pattern_recording;
39 static int solo ( void );
44 mutable volatile bool _cleared;
46 mutable volatile int _queued;
57 static int note_shape;
59 int draw_shape ( void ) const { return pattern::note_shape; }
61 static signal <void> signal_create_destroy;
67 pattern ( const pattern &rhs );
69 static int patterns ( void );
70 static pattern * pattern_by_number ( int n );
71 static void reset ( void );
72 static pattern * import ( smf *f, int track );
74 static pattern * recording ( void );
75 static void record_event ( const midievent *e );
77 pattern * create ( void );
78 pattern * by_number ( int n ) const;
80 pattern * clone ( void );
81 void put ( int x, int y, tick_t l );
82 const char * row_name ( int r ) const;
83 void draw_row_names ( Canvas *c ) const;
84 void trigger ( tick_t start, tick_t end );
85 void trigger ( void );
86 void stop ( void ) const;
87 void play ( tick_t start, tick_t end ) const;
91 void record( int mode );
92 void record_stop ( void );
94 void queue ( int mode );
95 int queue ( void ) const;
97 void randomize_row ( int y, int feel, float probability );
99 int port ( void ) const;
101 int channel ( void ) const;
102 void channel ( int c );
103 int note ( void ) const;
107 int mode ( void ) const;
109 int key ( void ) const;
112 int load ( const char *name );
113 void save ( const char *name ) const;
114 void dump ( smf *f ) const;
116 int ppqn ( void ) const;