--- gigedit/trunk/src/gigedit/dimregionedit.h 2007/10/27 12:28:33 1460 +++ gigedit/trunk/src/gigedit/dimregionedit.h 2015/01/04 19:46:54 2691 @@ -1,5 +1,5 @@ /* -*- c++ -*- - * Copyright (C) 2006, 2007 Andreas Persson + * Copyright (C) 2006-2015 Andreas Persson * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -22,42 +22,90 @@ #include +#include +#include #include #include #include #include -#include #include #include "paramedit.h" +class VelocityCurve : public Gtk::DrawingArea { +public: + VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)); + void set_dim_region(gig::DimensionRegion* d) { dimreg = d; } + +protected: +#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 + bool on_expose_event(GdkEventExpose* e); +#else + bool on_draw(const Cairo::RefPtr& cr); +#endif + +private: + double (gig::DimensionRegion::* const getter)(uint8_t); + gig::DimensionRegion* dimreg; +}; + +class CrossfadeCurve : public Gtk::DrawingArea { +public: + CrossfadeCurve(); + void set_dim_region(gig::DimensionRegion* d) { dimreg = d; } + +protected: +#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 + bool on_expose_event(GdkEventExpose* e); +#else + bool on_draw(const Cairo::RefPtr& cr); +#endif + +private: + gig::DimensionRegion* dimreg; + void draw_one_curve(const Cairo::RefPtr& cr, + const gig::DimensionRegion* d, + bool sensitive); +}; + class DimRegionEdit : public Gtk::Notebook { public: DimRegionEdit(); virtual ~DimRegionEdit(); void set_dim_region(gig::DimensionRegion* d); - bool set_sample(gig::Sample* sample); + bool set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop); Gtk::Entry* wSample; sigc::signal& signal_dimreg_to_be_changed(); sigc::signal& signal_dimreg_changed(); sigc::signal& signal_sample_ref_changed(); + sigc::signal& signal_select_sample(); + + std::set dimregs; protected: sigc::signal dimreg_to_be_changed_signal; sigc::signal dimreg_changed_signal; sigc::signal sample_ref_changed_signal; sigc::signal instrument_changed; + sigc::signal select_sample_signal; gig::DimensionRegion* dimregion; +#ifdef OLD_TOOLTIPS Gtk::Tooltips tooltips; +#endif Gtk::Table* table[7]; Gtk::Label* lSample; + VelocityCurve velocity_curve; + VelocityCurve release_curve; + VelocityCurve cutoff_curve; + CrossfadeCurve crossfade_curve; + NumEntryPermille eEG1PreAttack; NumEntryTemp eEG1Attack; NumEntryTemp eEG1Decay1; @@ -137,6 +185,8 @@ BoolEntry eMSDecode; NumEntryTemp eSampleStartOffset; NoteEntry eUnityNote; + ReadOnlyLabelWidget eSampleFormatInfo; + ReadOnlyLabelWidget eSampleID; NumEntryTemp eFineTune; NumEntryGain eGain; BoolEntryPlus6 eGainPlus6; @@ -146,6 +196,10 @@ ChoiceEntry eSampleLoopType; BoolEntry eSampleLoopInfinite; NumEntryTemp eSampleLoopPlayCount; + Gtk::Label* lEG2; + Gtk::Label* lLFO2; + + Gtk::Button buttonSelectSample; int rowno; int pageno; @@ -157,7 +211,8 @@ void addProp(LabelWidget& labelwidget); void addString(const char* labelText, Gtk::Label*& label, Gtk::Entry*& widget); - void addHeader(const char* text); + Gtk::Label* addHeader(const char* text); + void addRightHandSide(Gtk::Widget& widget); void nextPage(); void VCFEnabled_toggled(); @@ -180,8 +235,6 @@ void loop_length_changed(); void loop_infinite_toggled(); - std::set dimregs; - int update_model; // connect a widget to a setter function in DimRegionEdit @@ -253,6 +306,8 @@ void set_LoopLength(gig::DimensionRegion* d, uint32_t value); void set_LoopInfinite(gig::DimensionRegion* d, bool value); void set_LoopPlayCount(gig::DimensionRegion* d, uint32_t value); + + void onButtonSelectSamplePressed(); }; #endif