2 /*******************************************************************************/
3 /* Copyright (C) 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 /*******************************************************************************/
23 #include "Sequence_Point.H"
31 time_sig ( ) : beats_per_bar( 0 ), beat_type( 0 )
35 time_sig ( int bpb, int note ) : beats_per_bar( bpb ), beat_type( note )
40 class Time_Point : public Sequence_Point
48 _label = (char*)malloc( 40 );
50 snprintf( _label, 40, "%d/%d", _time.beats_per_bar, _time.beat_type );
56 // const char *class_name ( void ) { return "Time_Point"; }
58 virtual void get ( Log_Entry &e ) const;
59 void set ( Log_Entry &e );
60 void log_children ( void ) const;
66 LOG_CREATE_FUNC( Time_Point );
67 SEQUENCE_WIDGET_CLONE_FUNC( Time_Point );
69 static bool edit ( time_sig *sig );
71 Time_Point ( nframes_t when, int bpb, int note );
72 Time_Point ( const Time_Point &rhs );
77 time ( int bpb, int note )
79 _time.beats_per_bar = bpb; _time.beat_type = note;
83 time_sig time ( void ) const { return _time; }