(root)/wip/src/din_info.cc - Rev 1582
Rev 1559 |
Rev 1614 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
#include "din.h"
#include "console.h"
#include "ui_list.h"
extern string user_data_dir; // user data directory
extern int LEFT, BOTTOM, TOP; // din board extents
extern int HEIGHT; // default number of volumes on the microtonal keyboard
extern int WIDTH; // default number of microtones in a range
din_info::din_info () {
ifstream file ((user_data_dir + "din_info").c_str(), ios::in);
string ignore;
if (file) {
file >> ignore >> BOTTOM >> HEIGHT >> LEFT >> WIDTH;
TOP = BOTTOM + HEIGHT;
file >> ignore >> delay;
file >> ignore >> gater;
file >> ignore >> compress;
file >> ignore >> voice;
file >> ignore >> anchor;
file >> ignore >> vel;
file >> ignore >> accel;
file >> ignore >> fader::TIME;
file >> ignore >> rows >> cols;
gravity.load (file);
file >> ignore >> bounce.n;
file >> ignore >> bounce.speed;
file >> ignore >> bounce.style;
file >> ignore >> show_pitch_volume.board >> show_pitch_volume.drones;
float s, t;
file >> ignore >> s >> t;
drone_rise_time = din_info::s_time_range (s, t);
file >> ignore >> s >> t;
drone_fall_time = din_info::s_time_range (s, t);
file >> ignore >> snap.style >> snap.left >> snap.right;
file >> ignore >> sel_range >> mark_sel_range;
file >> ignore >> set_unset_toggle;
file >> ignore >> mesh_vars.order >> mesh_vars.point >> mesh_vars.duration >> mesh_vars.sync >> mesh_vars.dpp;
file >> mesh_vars.apply_to.active >> mesh_vars.apply_to.am >> mesh_vars.apply_to.fm;
file >> ignore >> drone_pend.spacing >> drone_pend.depth >> drone_pend.bpm >> drone_pend.orient;
file >> ignore >> create_this;
file >> ignore >> dist.pitch >> dist.vol >> dist.pix;
file >> ignore >> phrasor_right;
file >> ignore >> select_launched;
file >> ignore >> drone_is;
file >> ignore >> change_note;
file >> ignore >> change_note_style;
file >> ignore >> voice_is_voice;
file >> ignore >> drone::stiff;
file >> ignore >> modulator::afx_vel_min_mag;
file >> ignore >> drone::gabt;
dlog << "+++ finished reading din_info +++" << endl;
}
cons.last ();
}
void din_info::save () {
ofstream file ((user_data_dir + "din_info").c_str(), ios::out);
file << "board " << BOTTOM << SPC << HEIGHT << SPC << LEFT << SPC << WIDTH << endl;
file << "delay " << delay << endl;
file << "gater " << gater << endl;
file << "compress " << compress << endl;
file << "voice " << voice << endl;
file << "anchor " << anchor << endl;
file << "vel " << vel << endl;
file << "accel " << accel << endl;
file << "fade_time " << fader::TIME << endl;
file << "drone_mesh " << rows << SPC << cols << endl;
gravity.save (file);
file << "bounces " << bounce.n << endl;
file << "speed " << bounce.speed << endl;
file << "style " << bounce.style << endl;
file << "show_pitch_volume " << show_pitch_volume.board << SPC << show_pitch_volume.drones << endl;
file << "drone_rise_time " << drone_rise_time.min << SPC << drone_rise_time.max << endl;
file << "drone_fall_time " << drone_fall_time.min << SPC << drone_fall_time.max << endl;
file << "drone_snap " << snap.style << SPC << snap.left << SPC << snap.right << SPC << endl;
file << "selected_range " << sel_range << SPC << mark_sel_range << endl;
file << "set_unset_toggle " << set_unset_toggle << endl;
file << "mesh_vars " << mesh_vars.order << SPC << mesh_vars.point << SPC << mesh_vars.duration << SPC << mesh_vars.sync << SPC << mesh_vars.dpp;
file << SPC << mesh_vars.apply_to.active << SPC << mesh_vars.apply_to.am << SPC << mesh_vars.apply_to.fm << endl;
file << "drone_pendulum " << drone_pend.spacing << SPC << drone_pend.depth << SPC << drone_pend.bpm << SPC << drone_pend.orient << endl;
file << "mesh=0__pend=1 " << create_this << endl;
file << "dist_pitch_vol_pix " << dist.pitch << SPC << dist.vol << SPC << dist.pix << endl;
file << "phrasor_right " << MENU.s_phrase_position.extents.right << endl;
file << "select_launched " << select_launched << endl;
file << "drone_is " << !drone_is << endl;
file << "change_note " << !change_note << endl;
file << "change_note_style " << change_note_style << endl;
file << "voice_is_voice " << voice_is_voice << endl;
file << "stiffness " << drone::stiff << endl;
file << "afx_vel_min_mag " << modulator::afx_vel_min_mag << endl;
file << "drone-gab-time " << drone::gabt << endl;
dlog << "+++ saved din_info +++" << endl;
}