|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /*
- ZynAddSubFX - a software synthesizer
-
- BankView.h - View of Bank Widgets
- Copyright (C) 2016 Mark McCurry
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
- */
- #ifndef BANKVIEW_H
- #define BANKVIEW_H
-
- #include "Fl_Osc_Widget.H"
- #include "Fl_Osc_Choice.H"
- #include <FL/Fl_Group.H>
- #include <FL/Fl_Check_Button.H>
- #include <string>
-
- #include "common.H"
-
- class Bank;
- class BankView;
- class Fl_Check_Button;
-
- class BankList : public Fl_Osc_Choice
- {
- public:
- BankList(int x,int y, int w, int h, const char *label=0);
- void init(std::string path);
- void OSC_raw(const char *msg);
- };
-
- class BankSlot : public Fl_Button
- {
- public:
- BankSlot(int x,int y, int w, int h, const char *label=0);
- int handle(int event);
- void init(int nslot_, BankView *bv_);
-
- void update(const char *name__, const char *fname__);
-
- bool empty(void) const;
- const char *name(void) const;
- const char *filename(void) const;
- private:
- std::string name_;
- std::string filename_;
- char labelstr[128];
- int nslot;
- BankView *bv;
- };
-
- class BankViewControls: public Fl_Group
- {
- public:
- BankViewControls(int x,int y, int w, int h, const char *label=0);
- void init(BankView *bv_);
-
-
- int mode(void) const;
- void mode(int);
-
- private:
- Fl_Check_Button *read;
- Fl_Check_Button *write;
- Fl_Check_Button *clear;
- Fl_Check_Button *swap;
-
- //1 -> read
- //2 -> write
- //3 -> clear
- //4 -> swap
- int mode_;
-
- static void cb_clearbutton(Fl_Check_Button*, void*);
- static void cb_readbutton(Fl_Check_Button*, void*);
- static void cb_writebutton(Fl_Check_Button*, void*);
- };
-
- class BankView: public Fl_Group, public Fl_Osc_Widget
- {
- public:
- BankView(int x,int y, int w, int h, const char *label=0);
- ~BankView(void);
- void init(Fl_Osc_Interface *osc_, BankViewControls *bvc_, int *npart_);
-
- void react(int event, int slot);
-
- virtual void OSC_raw(const char *msg) override;
- void cbwig(Fl_Widget *w);
-
- void refresh(void);
- private:
- BankViewControls *bvc;
- BankSlot *slots[160];
-
- //XXX TODO locked banks...
- int nselected;
- int *npart;
-
- Fl_Widget *cbwig_;
- };
-
- #endif
|