Rev 1583 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*
* levels.h
* DIN Is Noise is copyright (c) 2006-2020 Jagannathan Sampath
* For more information, please visit https://dinisnoise.org/
*/
#ifndef __levels__
#define __levels__
#include "widget.h"
#include "box.h"
#include <string>
#include <vector>
struct levels : widget {
void load (); // load settings
void save (); // save settings
// gui vars
int elem_width;
int height;
int nlev;
int lastlev;
int lev; // edited level
float val; // edited val
int hgt; // edited height
int editable;
int edited; // values edited?
enum {STARTED=1, FINISH};
int editing; // editing element?
int stop_editing ();
int paint; // paint levels with mouse?
int lmb_clicked;
int prev_mousey;
int saveable;
std::vector<float> values; // 0 to 1 for each level
std::vector<int> heights; // 0 to height
bool* selection;
int nsel;
int sel_sz;
levels (const std::string& s);
~levels ();
int handle_input ();
float r, g, b;
float a, a0;
void draw ();
void clear_hgt_val ();
void calc_lev ();
void calc_hgt_val ();
int set (int i, float v, int h = -1);
void set_only (int i, float v);
int change (int i, float d);
int update_mul_lev (int dy);
void update ();
change_listener<levels>* lis;
void set_listener (change_listener<levels>* l) {
lis = l;
}
// left and right shift
int wrap;
int rshift ();
int lshift ();
void chkpos ();
void reheight ();
};
#endif