1 /* GSequencer - Advanced GTK Sequencer
2  * Copyright (C) 2005-2019 Joël Krähemann
3  *
4  * This file is part of GSequencer.
5  *
6  * GSequencer is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GSequencer is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GSequencer.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __AGS_TACTABLE_H__
21 #define __AGS_TACTABLE_H__
22 
23 #include <glib.h>
24 #include <glib-object.h>
25 
26 G_BEGIN_DECLS
27 
28 #define AGS_TYPE_TACTABLE                    (ags_tactable_get_type())
29 #define AGS_TACTABLE(obj)                    (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_TACTABLE, AgsTactable))
30 #define AGS_TACTABLE_INTERFACE(vtable)       (G_TYPE_CHECK_CLASS_CAST((vtable), AGS_TYPE_TACTABLE, AgsTactableInterface))
31 #define AGS_IS_TACTABLE(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_TACTABLE))
32 #define AGS_IS_TACTABLE_INTERFACE(vtable)    (G_TYPE_CHECK_CLASS_TYPE((vtable), AGS_TYPE_TACTABLE))
33 #define AGS_TACTABLE_GET_INTERFACE(obj)      (G_TYPE_INSTANCE_GET_INTERFACE((obj), AGS_TYPE_TACTABLE, AgsTactableInterface))
34 
35 typedef struct _AgsTactable AgsTactable;
36 typedef struct _AgsTactableInterface AgsTactableInterface;
37 
38 struct _AgsTactableInterface
39 {
40   GTypeInterface ginterface;
41 
42   guint64 (*get_sequencer_duration)(AgsTactable *tactable);
43   guint64 (*get_notation_duration)(AgsTactable *tactable);
44   guint64 (*get_wave_duration)(AgsTactable *tactable);
45   guint64 (*get_midi_duration)(AgsTactable *tactable);
46 
47   gdouble (*get_bpm)(AgsTactable *tactable);
48   gdouble (*get_tact)(AgsTactable *tactable);
49 
50   void (*change_sequencer_duration)(AgsTactable *tactable, guint64 sequencer_duration);
51   void (*change_notation_duration)(AgsTactable *tactable, guint64 notation_duration);
52   void (*change_wave_duration)(AgsTactable *tactable, guint64 wave_duration);
53   void (*change_midi_duration)(AgsTactable *tactable, guint64 midi_duration);
54 
55   void (*change_bpm)(AgsTactable *tactable, gdouble new_bpm, gdouble old_bpm);
56   void (*change_tact)(AgsTactable *tactable, gdouble new_tact, gdouble old_tact);
57 };
58 
59 GType ags_tactable_get_type();
60 
61 guint64 ags_tactable_get_sequencer_duration(AgsTactable *tactable);
62 guint64 ags_tactable_get_notation_duration(AgsTactable *tactable);
63 guint64 ags_tactable_get_wave_duration(AgsTactable *tactable);
64 guint64 ags_tactable_get_midi_duration(AgsTactable *tactable);
65 
66 gdouble ags_tactable_get_bpm(AgsTactable *tactable);
67 gdouble ags_tactable_get_tact(AgsTactable *tactable);
68 
69 void ags_tactable_change_sequencer_duration(AgsTactable *tactable, guint64 sequencer_duration);
70 void ags_tactable_change_notation_duration(AgsTactable *tactable, guint64 notation_duration);
71 void ags_tactable_change_wave_duration(AgsTactable *tactable, guint64 wave_duration);
72 void ags_tactable_change_midi_duration(AgsTactable *tactable, guint64 midi_duration);
73 
74 void ags_tactable_change_bpm(AgsTactable *tactable, gdouble new_bpm, gdouble old_bpm);
75 void ags_tactable_change_tact(AgsTactable *tactable, gdouble new_tact, gdouble old_tact);
76 
77 G_END_DECLS
78 
79 #endif /*__AGS_TACTABLE_H__*/
80