Make maximum beat length configurable on the GUI
This commit is contained in:
parent
e5f235273e
commit
1212d63312
@ -159,6 +159,7 @@ class GitSoundWindow(object):
|
|||||||
self.scale_combo = self.builder.get_object('scale-combo')
|
self.scale_combo = self.builder.get_object('scale-combo')
|
||||||
self.chooser_button = self.builder.get_object('repo-chooser')
|
self.chooser_button = self.builder.get_object('repo-chooser')
|
||||||
self.notelen_spin = self.builder.get_object('notelen-spin')
|
self.notelen_spin = self.builder.get_object('notelen-spin')
|
||||||
|
self.beatlen_spin = self.builder.get_object('beatlen-spin')
|
||||||
|
|
||||||
self.gitmidi = None
|
self.gitmidi = None
|
||||||
|
|
||||||
@ -293,6 +294,7 @@ class GitSoundWindow(object):
|
|||||||
skip = int(self.skip_spin.get_value())
|
skip = int(self.skip_spin.get_value())
|
||||||
vol_deviation = int(self.vol_spin.get_value())
|
vol_deviation = int(self.vol_spin.get_value())
|
||||||
notelen = self.notelen_spin.get_value()
|
notelen = self.notelen_spin.get_value()
|
||||||
|
beatlen = int(self.beatlen_spin.get_value()) or None
|
||||||
|
|
||||||
self.set_status("Generating data")
|
self.set_status("Generating data")
|
||||||
self.progressbar.set_fraction(0.0)
|
self.progressbar.set_fraction(0.0)
|
||||||
@ -304,7 +306,8 @@ class GitSoundWindow(object):
|
|||||||
program=PROGRAMS[program_selected],
|
program=PROGRAMS[program_selected],
|
||||||
volume_range=vol_deviation,
|
volume_range=vol_deviation,
|
||||||
skip=skip,
|
skip=skip,
|
||||||
note_duration=notelen)
|
note_duration=notelen,
|
||||||
|
max_beat_len=beatlen)
|
||||||
|
|
||||||
self.gitmidi.gen_repo_data(callback=self.genrepo_cb)
|
self.gitmidi.gen_repo_data(callback=self.genrepo_cb)
|
||||||
self.gitmidi.generate_midi(callback=self.genrepo_cb)
|
self.gitmidi.generate_midi(callback=self.genrepo_cb)
|
||||||
|
51
git-sound.ui
51
git-sound.ui
@ -42,6 +42,13 @@
|
|||||||
<property name="page_increment">1</property>
|
<property name="page_increment">1</property>
|
||||||
<property name="value">0.3</property>
|
<property name="value">0.3</property>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkAdjustment" id="beatlen-adjustment">
|
||||||
|
<property name="lower">0</property>
|
||||||
|
<property name="upper">10000.0</property>
|
||||||
|
<property name="step_increment">0</property>
|
||||||
|
<property name="page_increment">1</property>
|
||||||
|
<property name="value">0</property>
|
||||||
|
</object>
|
||||||
<object class="GtkWindow" id="main-window">
|
<object class="GtkWindow" id="main-window">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="title" translatable="yes">Git Sound</property>
|
<property name="title" translatable="yes">Git Sound</property>
|
||||||
@ -117,7 +124,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">7</property>
|
<property name="top_attach">8</property>
|
||||||
<property name="width">1</property>
|
<property name="width">1</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -135,7 +142,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="top_attach">7</property>
|
<property name="top_attach">8</property>
|
||||||
<property name="width">1</property>
|
<property name="width">1</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -153,7 +160,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">3</property>
|
<property name="left_attach">3</property>
|
||||||
<property name="top_attach">7</property>
|
<property name="top_attach">8</property>
|
||||||
<property name="width">1</property>
|
<property name="width">1</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -166,7 +173,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">8</property>
|
<property name="top_attach">9</property>
|
||||||
<property name="width">3</property>
|
<property name="width">3</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -239,7 +246,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">9</property>
|
<property name="top_attach">10</property>
|
||||||
<property name="width">4</property>
|
<property name="width">4</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -252,7 +259,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">3</property>
|
<property name="left_attach">3</property>
|
||||||
<property name="top_attach">8</property>
|
<property name="top_attach">9</property>
|
||||||
<property name="width">1</property>
|
<property name="width">1</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -315,6 +322,36 @@
|
|||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="beatlen-label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Maximum beat length</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">7</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinButton" id="beatlen-spin">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="text" translatable="yes">0.3</property>
|
||||||
|
<property name="adjustment">beatlen-adjustment</property>
|
||||||
|
<property name="value">0</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
<signal name="value-changed" handler="settings_changed" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">7</property>
|
||||||
|
<property name="width">3</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="vol-label">
|
<object class="GtkLabel" id="vol-label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@ -357,7 +394,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="top_attach">7</property>
|
<property name="top_attach">8</property>
|
||||||
<property name="width">1</property>
|
<property name="width">1</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
|
Loading…
Reference in New Issue
Block a user