mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
Only allow operations that do make sense.
This commit is contained in:
parent
07a76ef9e0
commit
b1d0c9f050
2 changed files with 16 additions and 13 deletions
|
@ -24,8 +24,8 @@
|
||||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
|
|
||||||
#include "../gui.hxx"
|
#include "../gui.hxx"
|
||||||
#define RECORD_BARS_MENU_ITEM(num) { #num, 0, setRecordBarsCb, (void*)num, FL_MENU_RADIO | ((clips[clipNum].getBeatsToRecord() == num*4) ? FL_ACTIVATE : 0) }
|
#define RECORD_BARS_MENU_ITEM(num) { #num, 0, setRecordBarsCb, (void*)num, FL_MENU_RADIO | ((clips[clipNum].getBeatsToRecord() == num*4) ? FL_ACTIVATE : 0 | empty ? 0 : FL_MENU_INACTIVE) }
|
||||||
#define RECORD_LENGTH_MENU_ITEM(num) {#num, 0, setLengthCb, (void*)num}
|
#define RECORD_LENGTH_MENU_ITEM(num) {#num, 0, setLengthCb, (void*)num, empty ? FL_MENU_INACTIVE : 0}
|
||||||
|
|
||||||
extern Gui* gui;
|
extern Gui* gui;
|
||||||
|
|
||||||
|
@ -337,6 +337,7 @@ int ClipSelector::handle(int event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool empty = clips[clipNum].getState() == GridLogic::STATE_EMPTY;
|
||||||
Fl_Menu_Item rclick_menu[] = {
|
Fl_Menu_Item rclick_menu[] = {
|
||||||
{ "Load" },
|
{ "Load" },
|
||||||
{ "Save" },
|
{ "Save" },
|
||||||
|
|
|
@ -189,10 +189,12 @@ void LooperClip::setPlayHead(float ph)
|
||||||
|
|
||||||
void LooperClip::setBarsToRecord(int bars)
|
void LooperClip::setBarsToRecord(int bars)
|
||||||
{
|
{
|
||||||
|
if(!(_playing || _queuePlay || _queueStop || _loaded)) {
|
||||||
_wantedBeats = bars * 4; // we set beats
|
_wantedBeats = bars * 4; // we set beats
|
||||||
EventClipBeatsChanged e( track, scene, _wantedBeats, true);
|
EventClipBeatsChanged e( track, scene, _wantedBeats, true);
|
||||||
writeToGuiRingbuffer(&e);
|
writeToGuiRingbuffer(&e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int LooperClip::getBeatsToRecord()
|
int LooperClip::getBeatsToRecord()
|
||||||
{
|
{
|
||||||
|
@ -253,14 +255,14 @@ size_t LooperClip::audioBufferSize()
|
||||||
|
|
||||||
void LooperClip::setBeats(int beats)
|
void LooperClip::setBeats(int beats)
|
||||||
{
|
{
|
||||||
if ( _buffer ) {
|
if (_loaded || _playing || _queuePlay || _queueStop || beats == 0) {
|
||||||
|
if(_buffer)
|
||||||
_buffer->setBeats( beats );
|
_buffer->setBeats( beats );
|
||||||
}
|
|
||||||
|
|
||||||
// Even on Reset!
|
|
||||||
EventClipBeatsChanged e(track, scene, beats, false);
|
EventClipBeatsChanged e(track, scene, beats, false);
|
||||||
writeToGuiRingbuffer(&e);
|
writeToGuiRingbuffer(&e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int LooperClip::getBeats()
|
int LooperClip::getBeats()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue