diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-01-03 11:50:41 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-01-03 11:50:41 +0100 |
commit | 756da05c384e3d9258fc07cf9441d899238503f1 (patch) | |
tree | b3385216148d51a2378a2bed5dfc3f0a27d4f1ec /plugingui | |
parent | 645250e1cd8ce9bc1faea599df7a1b05836bfeb8 (diff) |
Add dggui namespace to libdggui components.
Diffstat (limited to 'plugingui')
39 files changed, 451 insertions, 417 deletions
diff --git a/plugingui/abouttab.cc b/plugingui/abouttab.cc index 094ed5d..b6b1325 100644 --- a/plugingui/abouttab.cc +++ b/plugingui/abouttab.cc @@ -37,13 +37,13 @@ std::string getLocalizedFile(const std::string& file) { auto language = Translation::getISO639LanguageName(); std::string file_localized = file + "." + language; - GUI::Resource resource_localized{file_localized}; + dggui::Resource resource_localized{file_localized}; if(resource_localized.valid()) { return resource_localized.data(); } - GUI::Resource resource{file}; + dggui::Resource resource{file}; if(resource.valid()) { return resource.data(); @@ -56,8 +56,8 @@ std::string getLocalizedFile(const std::string& file) namespace GUI { -AboutTab::AboutTab(Widget* parent) - : Widget(parent) +AboutTab::AboutTab(dggui::Widget* parent) + : dggui::Widget(parent) { text_edit.setText(getAboutText()); text_edit.setReadOnly(true); @@ -68,7 +68,7 @@ AboutTab::AboutTab(Widget* parent) void AboutTab::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); text_edit.resize(std::max((int)width - 2*margin, 0), std::max((int)height - 2*margin, 0)); } @@ -83,7 +83,7 @@ std::string AboutTab::getAboutText() " About\n" "=============\n" "\n")); - about_text.append(UTF8().toLatin1(getLocalizedFile(":../ABOUT"))); + about_text.append(dggui::UTF8().toLatin1(getLocalizedFile(":../ABOUT"))); // Version about_text.append(_( @@ -101,7 +101,7 @@ std::string AboutTab::getAboutText() " Bugs\n" "=============\n" "\n")); - about_text.append(UTF8().toLatin1(getLocalizedFile(":../BUGS"))); + about_text.append(dggui::UTF8().toLatin1(getLocalizedFile(":../BUGS"))); // Authors about_text.append(_( @@ -110,7 +110,7 @@ std::string AboutTab::getAboutText() " Authors\n" "=============\n" "\n")); - about_text.append(UTF8().toLatin1(getLocalizedFile(":../AUTHORS"))); + about_text.append(dggui::UTF8().toLatin1(getLocalizedFile(":../AUTHORS"))); // GPL about_text.append(_( @@ -119,7 +119,7 @@ std::string AboutTab::getAboutText() " License\n" "=============\n" "\n")); - about_text.append(UTF8().toLatin1(getLocalizedFile(":../COPYING"))); + about_text.append(dggui::UTF8().toLatin1(getLocalizedFile(":../COPYING"))); return about_text; } diff --git a/plugingui/abouttab.h b/plugingui/abouttab.h index 99653d1..48c9137 100644 --- a/plugingui/abouttab.h +++ b/plugingui/abouttab.h @@ -36,10 +36,10 @@ namespace GUI { class AboutTab - : public Widget + : public dggui::Widget { public: - AboutTab(Widget* parent); + AboutTab(dggui::Widget* parent); // From Widget: void resize(std::size_t width, std::size_t height) override; @@ -47,7 +47,7 @@ public: private: std::string getAboutText(); - TextEdit text_edit{this}; + dggui::TextEdit text_edit{this}; int margin{10}; }; diff --git a/plugingui/bleedcontrolframecontent.cc b/plugingui/bleedcontrolframecontent.cc index b999062..e5e46c9 100644 --- a/plugingui/bleedcontrolframecontent.cc +++ b/plugingui/bleedcontrolframecontent.cc @@ -35,19 +35,19 @@ namespace GUI { -BleedcontrolframeContent::BleedcontrolframeContent(Widget* parent, +BleedcontrolframeContent::BleedcontrolframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , slider_width{250} , settings(settings) , settings_notifier(settings_notifier) { label_text.setText(_("Master Bleed Volume:")); - label_text.setAlignment(TextAlignment::center); + label_text.setAlignment(dggui::TextAlignment::center); label_value.setText(_("0 %")); - label_value.setAlignment(TextAlignment::center); + label_value.setAlignment(dggui::TextAlignment::center); CONNECT(this, settings_notifier.master_bleed, this, &BleedcontrolframeContent::bleedSettingsValueChanged); @@ -57,7 +57,7 @@ BleedcontrolframeContent::BleedcontrolframeContent(Widget* parent, void BleedcontrolframeContent::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); slider_width = 0.8 * width; auto x_start = 0.1 * width; @@ -75,12 +75,14 @@ void BleedcontrolframeContent::setEnabled(bool enabled) { this->enabled = enabled; - if (enabled) { + if(enabled) + { label_text.resetColour(); label_value.resetColour(); slider.setEnabled(true); } - else { + else + { label_text.setColour(0.7); label_value.setColour(0.7); slider.setEnabled(false); @@ -95,7 +97,7 @@ void BleedcontrolframeContent::bleedSettingsValueChanged(float value) int percentage = 100 * value; label_value.setText(std::to_string(percentage) + " %"); - slider.setColour(Slider::Colour::Blue); + slider.setColour(dggui::Slider::Colour::Blue); } void BleedcontrolframeContent::bleedValueChanged(float value) diff --git a/plugingui/bleedcontrolframecontent.h b/plugingui/bleedcontrolframecontent.h index d4f6c2e..fadb98e 100644 --- a/plugingui/bleedcontrolframecontent.h +++ b/plugingui/bleedcontrolframecontent.h @@ -35,10 +35,11 @@ class SettingsNotifier; namespace GUI { -class BleedcontrolframeContent : public Widget +class BleedcontrolframeContent + : public dggui::Widget { public: - BleedcontrolframeContent(Widget* parent, + BleedcontrolframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); @@ -53,10 +54,10 @@ private: bool enabled = true; - Label label_text{this}; - Label label_value{this}; + dggui::Label label_text{this}; + dggui::Label label_value{this}; - Slider slider{this}; + dggui::Slider slider{this}; int slider_width; diff --git a/plugingui/diskstreamingframecontent.cc b/plugingui/diskstreamingframecontent.cc index 97937df..4c63817 100644 --- a/plugingui/diskstreamingframecontent.cc +++ b/plugingui/diskstreamingframecontent.cc @@ -35,22 +35,22 @@ namespace GUI { -DiskstreamingframeContent::DiskstreamingframeContent(Widget* parent, +DiskstreamingframeContent::DiskstreamingframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , slider_width{250} , settings(settings) , settings_notifier(settings_notifier) { label_text.setText(_("Cache limit (max memory usage):")); - label_text.setAlignment(TextAlignment::center); + label_text.setAlignment(dggui::TextAlignment::center); button.setText(_("Apply")); button.setEnabled(false); label_value.setText(_("0 MB")); - label_value.setAlignment(TextAlignment::center); + label_value.setAlignment(dggui::TextAlignment::center); CONNECT(this, settings_notifier.disk_cache_upper_limit, this, &DiskstreamingframeContent::limitSettingsValueChanged); @@ -73,7 +73,7 @@ DiskstreamingframeContent::DiskstreamingframeContent(Widget* parent, void DiskstreamingframeContent::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); int slider_button_gap = 10; @@ -98,14 +98,16 @@ void DiskstreamingframeContent::limitSettingsValueChanged(std::size_t value) float new_slider_value = (float)(value - min_limit)/(max_limit - min_limit); slider.setValue(new_slider_value); - if (new_slider_value < 0.99) { + if(new_slider_value < 0.99) + { int value_in_mb = value/(1024 * 1024); label_value.setText(std::to_string(value_in_mb) + " MB"); - slider.setColour(Slider::Colour::Blue); + slider.setColour(dggui::Slider::Colour::Blue); } - else { + else + { label_value.setText(_("Unlimited")); - slider.setColour(Slider::Colour::Grey); + slider.setColour(dggui::Slider::Colour::Grey); } button.setEnabled(true); diff --git a/plugingui/diskstreamingframecontent.h b/plugingui/diskstreamingframecontent.h index 1f7ab39..10ed90a 100644 --- a/plugingui/diskstreamingframecontent.h +++ b/plugingui/diskstreamingframecontent.h @@ -37,10 +37,11 @@ class SettingsNotifier; namespace GUI { -class DiskstreamingframeContent : public Widget +class DiskstreamingframeContent + : public dggui::Widget { public: - DiskstreamingframeContent(Widget* parent, + DiskstreamingframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); @@ -57,11 +58,11 @@ private: static constexpr std::size_t min_limit = 1024.0 * 1024.0 * 32; static constexpr std::size_t max_limit = 1024.0 * 1024.0 * 1024.0 * 4.0 - 1; - Label label_text{this}; - Label label_value{this}; + dggui::Label label_text{this}; + dggui::Label label_value{this}; - Slider slider{this}; - Button button{this}; + dggui::Slider slider{this}; + dggui::Button button{this}; int slider_width; int button_width; diff --git a/plugingui/drumkitframecontent.cc b/plugingui/drumkitframecontent.cc index 2bdff7a..9549d75 100644 --- a/plugingui/drumkitframecontent.cc +++ b/plugingui/drumkitframecontent.cc @@ -35,11 +35,11 @@ namespace GUI { -BrowseFile::BrowseFile(Widget* parent) - : Widget(parent) +BrowseFile::BrowseFile(dggui::Widget* parent) + : dggui::Widget(parent) { layout.setResizeChildren(false); - layout.setVAlignment(VAlignment::center); + layout.setVAlignment(dggui::VAlignment::center); layout.setSpacing(gap); layout.addItem(&lineedit); @@ -50,7 +50,7 @@ BrowseFile::BrowseFile(Widget* parent) void BrowseFile::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); lineedit_width = std::max((int)(0.77 * (int)width - gap), 0); button_width = std::max((int)width - lineedit_width - gap, 0); @@ -71,26 +71,26 @@ std::size_t BrowseFile::getButtonWidth() return button_width; } -Button& BrowseFile::getBrowseButton() +dggui::Button& BrowseFile::getBrowseButton() { return browse_button; } -LineEdit& BrowseFile::getLineEdit() +dggui::LineEdit& BrowseFile::getLineEdit() { return lineedit; } -DrumkitframeContent::DrumkitframeContent(Widget* parent, +DrumkitframeContent::DrumkitframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier, Config& config) - : Widget(parent) + : dggui::Widget(parent) , settings(settings) , settings_notifier(settings_notifier) , config(config) { - layout.setHAlignment(HAlignment::left); + layout.setHAlignment(dggui::HAlignment::left); drumkit_caption.setText(_("Drumkit file:")); midimap_caption.setText(_("Midimap file:")); @@ -110,20 +110,20 @@ DrumkitframeContent::DrumkitframeContent(Widget* parent, CONNECT(this, settings_notifier.drumkit_file, - &drumkit_file.getLineEdit(), &LineEdit::setText); + &drumkit_file.getLineEdit(), &dggui::LineEdit::setText); CONNECT(this, settings_notifier.drumkit_load_status, this, &DrumkitframeContent::setDrumKitLoadStatus); CONNECT(this, settings_notifier.midimap_file, - &midimap_file.getLineEdit(), &LineEdit::setText); + &midimap_file.getLineEdit(), &dggui::LineEdit::setText); CONNECT(this, settings_notifier.midimap_load_status, this, &DrumkitframeContent::setMidiMapLoadStatus); CONNECT(this, settings_notifier.number_of_files, - &drumkit_file_progress, &ProgressBar::setTotal); + &drumkit_file_progress, &dggui::ProgressBar::setTotal); CONNECT(this, settings_notifier.number_of_files_loaded, - &drumkit_file_progress, &ProgressBar::setValue); + &drumkit_file_progress, &dggui::ProgressBar::setValue); CONNECT(this, file_browser. defaultPathChangedNotifier, this, &DrumkitframeContent::defaultPathChanged); @@ -136,7 +136,7 @@ DrumkitframeContent::DrumkitframeContent(Widget* parent, void DrumkitframeContent::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); drumkit_caption.resize(width, 15); drumkit_file.resize(width, 37); @@ -169,8 +169,8 @@ void DrumkitframeContent::kitBrowseClick() CONNECT(&file_browser, fileSelectNotifier, this, &DrumkitframeContent::selectKitFile); file_browser.show(); - Point p{ window()->x() + (int)window()->width() / 2, - window()->y() + (int)window()->height() / 2 }; + dggui::Point p{ window()->x() + (int)window()->width() / 2, + window()->y() + (int)window()->height() / 2 }; auto p0 = window()->translateToScreen(p); auto sz = file_browser.window()->getNativeSize(); file_browser.move(p0.x - sz.width / 2, @@ -197,8 +197,8 @@ void DrumkitframeContent::midimapBrowseClick() CONNECT(&file_browser, fileSelectNotifier, this, &DrumkitframeContent::selectMapFile); file_browser.show(); - Point p{ window()->x() + (int)window()->width() / 2, - window()->y() + (int)window()->height() / 2 }; + dggui::Point p{ window()->x() + (int)window()->width() / 2, + window()->y() + (int)window()->height() / 2 }; auto p0 = window()->translateToScreen(p); auto sz = file_browser.window()->getNativeSize(); file_browser.move(p0.x - sz.width / 2, @@ -229,18 +229,18 @@ void DrumkitframeContent::selectMapFile(const std::string& filename) void DrumkitframeContent::setDrumKitLoadStatus(LoadStatus load_status) { - ProgressBarState state = ProgressBarState::Blue; + auto state = dggui::ProgressBarState::Blue; switch(load_status) { case LoadStatus::Idle: case LoadStatus::Loading: - state = ProgressBarState::Blue; + state = dggui::ProgressBarState::Blue; break; case LoadStatus::Done: - state = ProgressBarState::Green; + state = dggui::ProgressBarState::Green; break; case LoadStatus::Error: - state = ProgressBarState::Red; + state = dggui::ProgressBarState::Red; break; } @@ -249,7 +249,7 @@ void DrumkitframeContent::setDrumKitLoadStatus(LoadStatus load_status) void DrumkitframeContent::setMidiMapLoadStatus(LoadStatus load_status) { - ProgressBarState state = ProgressBarState::Blue; + auto state = dggui::ProgressBarState::Blue; switch(load_status) { case LoadStatus::Idle: @@ -257,15 +257,15 @@ void DrumkitframeContent::setMidiMapLoadStatus(LoadStatus load_status) break; case LoadStatus::Loading: midimap_file_progress.setValue(1); - state = ProgressBarState::Blue; + state = dggui::ProgressBarState::Blue; break; case LoadStatus::Done: midimap_file_progress.setValue(2); - state = ProgressBarState::Green; + state = dggui::ProgressBarState::Green; break; case LoadStatus::Error: midimap_file_progress.setValue(2); - state = ProgressBarState::Red; + state = dggui::ProgressBarState::Red; break; } diff --git a/plugingui/drumkitframecontent.h b/plugingui/drumkitframecontent.h index 3661d8e..4c5cc9e 100644 --- a/plugingui/drumkitframecontent.h +++ b/plugingui/drumkitframecontent.h @@ -42,10 +42,10 @@ namespace GUI class Config; class BrowseFile - : public Widget + : public dggui::Widget { public: - BrowseFile(Widget* parent); + BrowseFile(dggui::Widget* parent); // From Widget virtual void resize(std::size_t width, std::size_t height) override; @@ -53,14 +53,14 @@ public: std::size_t getLineEditWidth(); std::size_t getButtonWidth(); - Button& getBrowseButton(); - LineEdit& getLineEdit(); + dggui::Button& getBrowseButton(); + dggui::LineEdit& getLineEdit(); private: - HBoxLayout layout{this}; + dggui::HBoxLayout layout{this}; - LineEdit lineedit{this}; - Button browse_button{this}; + dggui::LineEdit lineedit{this}; + dggui::Button browse_button{this}; int lineedit_width; int button_width; @@ -68,10 +68,10 @@ private: }; class DrumkitframeContent - : public Widget + : public dggui::Widget { public: - DrumkitframeContent(Widget* parent, + DrumkitframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier, Config& config); @@ -91,14 +91,14 @@ private: void setDrumKitLoadStatus(LoadStatus load_status); void setMidiMapLoadStatus(LoadStatus load_status); - VBoxLayout layout{this}; + dggui::VBoxLayout layout{this}; - Label drumkit_caption{this}; - Label midimap_caption{this}; + dggui::Label drumkit_caption{this}; + dggui::Label midimap_caption{this}; BrowseFile drumkit_file{this}; BrowseFile midimap_file{this}; - ProgressBar drumkit_file_progress{this}; - ProgressBar midimap_file_progress{this}; + dggui::ProgressBar drumkit_file_progress{this}; + dggui::ProgressBar midimap_file_progress{this}; FileBrowser file_browser{this}; diff --git a/plugingui/drumkittab.cc b/plugingui/drumkittab.cc index 46c448e..6323e94 100644 --- a/plugingui/drumkittab.cc +++ b/plugingui/drumkittab.cc @@ -42,10 +42,10 @@ namespace GUI { -DrumkitTab::DrumkitTab(Widget* parent, +DrumkitTab::DrumkitTab(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , settings(settings) , settings_notifier(settings_notifier) { @@ -65,11 +65,11 @@ DrumkitTab::DrumkitTab(Widget* parent, void DrumkitTab::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); if(drumkit_image) { - Painter painter(*this); + dggui::Painter painter(*this); painter.clear(); drumkit_image_x = (this->width()-drumkit_image->width())/2; @@ -82,24 +82,24 @@ void DrumkitTab::resize(std::size_t width, std::size_t height) height-instrument_name_label.height()-5); } -void DrumkitTab::buttonEvent(ButtonEvent* buttonEvent) +void DrumkitTab::buttonEvent(dggui::ButtonEvent* buttonEvent) { if(map_image) { - if(buttonEvent->button == MouseButton::right) + if(buttonEvent->button == dggui::MouseButton::right) { - if(buttonEvent->direction == GUI::Direction::down) + if(buttonEvent->direction == dggui::Direction::down) { - Painter painter(*this); + dggui::Painter painter(*this); painter.drawImage(drumkit_image_x, drumkit_image_y, *map_image); shows_overlay = true; redraw(); return; } - if(buttonEvent->direction == GUI::Direction::up) + if(buttonEvent->direction == dggui::Direction::up) { - Painter painter(*this); + dggui::Painter painter(*this); painter.clear(); painter.drawImage(drumkit_image_x, drumkit_image_y, *drumkit_image); @@ -112,20 +112,20 @@ void DrumkitTab::buttonEvent(ButtonEvent* buttonEvent) } } - if(buttonEvent->button == MouseButton::left) + if(buttonEvent->button == dggui::MouseButton::left) { - if(buttonEvent->direction == GUI::Direction::down) + if(buttonEvent->direction == dggui::Direction::down) { triggerAudition(buttonEvent->x, buttonEvent->y); highlightInstrument(current_index); redraw(); } - if(buttonEvent->direction == GUI::Direction::up) + if(buttonEvent->direction == dggui::Direction::up) { if(shows_instrument_overlay) { - Painter painter(*this); + dggui::Painter painter(*this); painter.clear(); painter.drawImage(drumkit_image_x, drumkit_image_y, *drumkit_image); if(shows_overlay) @@ -140,9 +140,9 @@ void DrumkitTab::buttonEvent(ButtonEvent* buttonEvent) } } -void DrumkitTab::scrollEvent(ScrollEvent* scrollEvent) +void DrumkitTab::scrollEvent(dggui::ScrollEvent* scrollEvent) { - current_velocity -= 0.01*scrollEvent->delta; + current_velocity -= 0.01 * scrollEvent->delta; current_velocity = std::max(std::min(current_velocity, 1.0f), 0.0f); updateVelocityLabel(); velocity_label.resizeToText(); @@ -150,18 +150,22 @@ void DrumkitTab::scrollEvent(ScrollEvent* scrollEvent) triggerAudition(scrollEvent->x, scrollEvent->y); } -void DrumkitTab::mouseMoveEvent(MouseMoveEvent* mouseMoveEvent) +void DrumkitTab::mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent) { // change to image coordinates - auto const x = mouseMoveEvent->x - drumkit_image_x; - auto const y = mouseMoveEvent->y - drumkit_image_y; + const auto x = mouseMoveEvent->x - drumkit_image_x; + const auto y = mouseMoveEvent->y - drumkit_image_y; auto index = pos_to_colour_index(x, y); - if(index == current_index) { return; } + if(index == current_index) + { + return; + } + current_index = index; - Painter painter(*this); + dggui::Painter painter(*this); painter.clear(); painter.drawImage(drumkit_image_x, drumkit_image_y, *drumkit_image); if(shows_overlay) @@ -178,7 +182,7 @@ void DrumkitTab::mouseLeaveEvent() { if(map_image && (shows_overlay || shows_instrument_overlay)) { - Painter painter(*this); + dggui::Painter painter(*this); painter.clear(); painter.drawImage(drumkit_image_x, drumkit_image_y, *drumkit_image); @@ -212,8 +216,8 @@ void DrumkitTab::highlightInstrument(int index) { if(index != -1) { - Painter painter(*this); - auto const& colour = colours[index]; + dggui::Painter painter(*this); + const auto& colour = colours[index]; //Colour colour(1.0f, 1.0f, 0.0f); auto const& positions = colour_index_to_positions[index]; painter.draw(positions.begin(), positions.end(), @@ -240,11 +244,11 @@ void DrumkitTab::updateInstrumentLabel(int index) instrument_name_label.resizeToText(); } -void DrumkitTab::init(std::string const& image_file, - std::string const& map_file) +void DrumkitTab::init(const std::string& image_file, + const std::string& map_file) { - drumkit_image = std::make_unique<Image>(image_file); - map_image = std::make_unique<Image>(map_file); + drumkit_image = std::make_unique<dggui::Image>(image_file); + map_image = std::make_unique<dggui::Image>(map_file); // collect all colours and build lookup table auto const height = map_image->height(); @@ -321,7 +325,7 @@ void DrumkitTab::drumkitFileChanged(const std::string& drumkit_file) float red = (hex_colour >> 16 & 0xff) / 255.0f; float green = (hex_colour >> 8 & 0xff) / 255.0f; float blue = (hex_colour >> 0 & 0xff) / 255.0f; - Colour colour(red, green, blue); + dggui::Colour colour(red, green, blue); colour_instrument_pairs.push_back({colour, clickmap.instrument}); } catch(...) diff --git a/plugingui/drumkittab.h b/plugingui/drumkittab.h index 3243fba..ad89fb1 100644 --- a/plugingui/drumkittab.h +++ b/plugingui/drumkittab.h @@ -45,21 +45,21 @@ namespace GUI class Config; class DrumkitTab - : public Widget + : public dggui::Widget { public: - DrumkitTab(Widget* parent, + DrumkitTab(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); - // From Widget: + // From dggui::Widget: void resize(std::size_t width, std::size_t height) override; - void buttonEvent(ButtonEvent* buttonEvent) override; - void scrollEvent(ScrollEvent* scrollEvent) override; - void mouseMoveEvent(MouseMoveEvent* mouseMoveEvent) override; + void buttonEvent(dggui::ButtonEvent* buttonEvent) override; + void scrollEvent(dggui::ScrollEvent* scrollEvent) override; + void mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent) override; void mouseLeaveEvent() override; - void init(std::string const& image_file, std::string const& map_file); + void init(const std::string& image_file, const std::string& map_file); Notifier<bool> imageChangeNotifier; // bool has_valid_image @@ -72,34 +72,34 @@ private: using Position = IndexGrid::Pos; using Positions = std::vector<Position>; - std::vector<Colour> colours; + std::vector<dggui::Colour> colours; IndexGrid pos_to_colour_index; std::vector<Positions> colour_index_to_positions; std::vector<std::string> to_instrument_name; struct ColourInstrumentPair { - Colour colour; + dggui::Colour colour; std::string instrument; }; // FIXME: load this from instrument file std::vector<ColourInstrumentPair> colour_instrument_pairs = { - {Colour(0), "Snare"}, - {Colour(255./255, 15./255, 55./255), "KdrumL"}, - {Colour(154./255, 153./255, 33./255), "HihatClosed"}, - {Colour(248./255, 221./255, 37./255), "Tom4"} + {dggui::Colour(0), "Snare"}, + {dggui::Colour(255./255, 15./255, 55./255), "KdrumL"}, + {dggui::Colour(154./255, 153./255, 33./255), "HihatClosed"}, + {dggui::Colour(248./255, 221./255, 37./255), "Tom4"} }; bool shows_overlay{false}; bool shows_instrument_overlay{false}; - std::unique_ptr<Image> drumkit_image; - std::unique_ptr<Image> map_image; + std::unique_ptr<dggui::Image> drumkit_image; + std::unique_ptr<dggui::Image> map_image; int drumkit_image_x; int drumkit_image_y; - Label velocity_label{this}; - Label instrument_name_label{this}; + dggui::Label velocity_label{this}; + dggui::Label instrument_name_label{this}; Settings& settings; SettingsNotifier& settings_notifier; diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc index 9f322c8..d4fc009 100644 --- a/plugingui/filebrowser.cc +++ b/plugingui/filebrowser.cc @@ -48,8 +48,8 @@ namespace GUI { -FileBrowser::FileBrowser(Widget* parent) - : Dialog(parent, true) +FileBrowser::FileBrowser(dggui::Widget* parent) + : dggui::Dialog(parent, true) , dir(Directory::cwd()) , lbl_path(this) , lineedit(this) @@ -106,7 +106,7 @@ void FileBrowser::setPath(const std::string& path) void FileBrowser::resize(std::size_t width, std::size_t height) { - Dialog::resize(width, height); + dggui::Dialog::resize(width, height); int offset = 0; int brd = 5; // border @@ -139,9 +139,9 @@ void FileBrowser::resize(std::size_t width, std::size_t height) btn_sel.resize(btn_w, btn_h); } -void FileBrowser::repaintEvent(RepaintEvent* repaintEvent) +void FileBrowser::repaintEvent(dggui::RepaintEvent* repaintEvent) { - Painter p(*this); + dggui::Painter p(*this); p.drawImageStretched(0,0, back, width(), height()); } @@ -233,7 +233,7 @@ void FileBrowser::changeDir() return; } - std::vector<ListBoxBasic::Item> items; + std::vector<dggui::ListBoxBasic::Item> items; #if DG_PLATFORM == DG_PLATFORM_WINDOWS if(Directory::isRoot(dir.path()) && (value == "..")) @@ -241,7 +241,7 @@ void FileBrowser::changeDir() DEBUG(filebrowser, _("Showing partitions...\n")); for(auto drive : dir.drives()) { - ListBoxBasic::Item item; + dggui::ListBoxBasic::Item item; item.name = drive.name; item.value = drive.name; items.push_back(item); @@ -271,7 +271,7 @@ void FileBrowser::changeDir() for(auto entry : entries) { - ListBoxBasic::Item item; + dggui::ListBoxBasic::Item item; item.name = entry; item.value = entry; items.push_back(item); diff --git a/plugingui/filebrowser.h b/plugingui/filebrowser.h index 53a058d..0620ef3 100644 --- a/plugingui/filebrowser.h +++ b/plugingui/filebrowser.h @@ -41,10 +41,10 @@ namespace GUI { class FileBrowser - : public Dialog + : public dggui::Dialog { public: - FileBrowser(Widget* parent); + FileBrowser(dggui::Widget* parent); void setPath(const std::string& path); @@ -54,7 +54,7 @@ public: // From Widget: bool isFocusable() override { return true; } - virtual void repaintEvent(RepaintEvent* repaintEvent) override; + virtual void repaintEvent(dggui::RepaintEvent* repaintEvent) override; virtual void resize(std::size_t width, std::size_t height) override; //! Return the filename selected in the browser. @@ -81,16 +81,16 @@ private: void select(const std::string& file); void changeDir(); - Label lbl_path; + dggui::Label lbl_path; - LineEdit lineedit; - ListBox listbox; + dggui::LineEdit lineedit; + dggui::ListBox listbox; - Button btn_sel; - Button btn_def; - Button btn_esc; + dggui::Button btn_sel; + dggui::Button btn_def; + dggui::Button btn_esc; - Image back; + dggui::Image back; bool has_filename{false}; std::string filename; diff --git a/plugingui/humaniservisualiser.cc b/plugingui/humaniservisualiser.cc index 2a17197..1045e31 100644 --- a/plugingui/humaniservisualiser.cc +++ b/plugingui/humaniservisualiser.cc @@ -33,18 +33,21 @@ #include <hugin.hpp> -HumaniserVisualiser::HumaniserVisualiser(GUI::Widget* parent, +namespace GUI +{ + +HumaniserVisualiser::HumaniserVisualiser(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : GUI::Widget(parent) + : dggui::Widget(parent) , canvas(this, settings, settings_notifier) { canvas.move(7, 7); } -void HumaniserVisualiser::repaintEvent(GUI::RepaintEvent *repaintEvent) +void HumaniserVisualiser::repaintEvent(dggui::RepaintEvent *repaintEvent) { - GUI::Painter p(*this); + dggui::Painter p(*this); box.setSize(width(), height()); p.drawImage(0, 0, box); @@ -52,7 +55,7 @@ void HumaniserVisualiser::repaintEvent(GUI::RepaintEvent *repaintEvent) void HumaniserVisualiser::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); if(width < 14 || height < 14) { canvas.resize(1, 1); @@ -61,10 +64,10 @@ void HumaniserVisualiser::resize(std::size_t width, std::size_t height) canvas.resize(width - 14, height - 14); } -HumaniserVisualiser::Canvas::Canvas(GUI::Widget* parent, +HumaniserVisualiser::Canvas::Canvas(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : GUI::Widget(parent) + : dggui::Widget(parent) , settings_notifier(settings_notifier) , latency_max_ms(settings.latency_max_ms.load()) , settings(settings) @@ -87,14 +90,14 @@ HumaniserVisualiser::Canvas::Canvas(GUI::Widget* parent, this, &HumaniserVisualiser::Canvas::velocityStddevChanged); } -void HumaniserVisualiser::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) +void HumaniserVisualiser::Canvas::repaintEvent(dggui::RepaintEvent *repaintEvent) { if(width() < 1 || height() < 1) { return; } - GUI::Painter p(*this); + dggui::Painter p(*this); p.clear(); @@ -131,26 +134,26 @@ void HumaniserVisualiser::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) // Lines if(velocity_enabled) { - p.setColour(GUI::Colour(0.0f, 1.0f, 1.0f)); + p.setColour(dggui::Colour(0.0f, 1.0f, 1.0f)); } else { - p.setColour(GUI::Colour(0.4f, 0.4f, 0.4f)); + p.setColour(dggui::Colour(0.4f, 0.4f, 0.4f)); } p.drawLine(0, y, width(), y); if(latency_enabled) { - p.setColour(GUI::Colour(0.0f, 1.0f, 1.0f)); + p.setColour(dggui::Colour(0.0f, 1.0f, 1.0f)); } else { - p.setColour(GUI::Colour(0.4f, 0.4f, 0.4f)); + p.setColour(dggui::Colour(0.4f, 0.4f, 0.4f)); } p.drawLine(x, 0, x, height()); // Zero-lines - p.setColour(GUI::Colour(0.0f, 1.0f, 0.0f, 0.9f)); + p.setColour(dggui::Colour(0.0f, 1.0f, 0.0f, 0.9f)); p.drawLine(0, height() * 0.2f, width(), height() * 0.2f); p.drawLine(width() / 2, 0, width() / 2, height()); } @@ -196,3 +199,5 @@ void HumaniserVisualiser::Canvas::velocityStddevChanged(float stddev) velocity_stddev = stddev; redraw(); } + +} // ::GUI diff --git a/plugingui/humaniservisualiser.h b/plugingui/humaniservisualiser.h index 41179fa..028f10d 100644 --- a/plugingui/humaniservisualiser.h +++ b/plugingui/humaniservisualiser.h @@ -33,33 +33,36 @@ struct Settings; class SettingsNotifier; +namespace GUI +{ + class HumaniserVisualiser - : public GUI::Widget + : public dggui::Widget { public: - HumaniserVisualiser(GUI::Widget* parent, + HumaniserVisualiser(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); // From Widget: - virtual void repaintEvent(GUI::RepaintEvent *repaintEvent) override; + virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override; virtual void resize(std::size_t width, std::size_t height) override; private: - GUI::TexturedBox box{getImageCache(), ":resources/widget.png", + dggui::TexturedBox box{getImageCache(), ":resources/widget.png", 0, 0, // atlas offset (x, y) 7, 1, 7, // dx1, dx2, dx3 7, 63, 7}; // dy1, dy2, dy3 class Canvas - : public GUI::Widget + : public dggui::Widget { public: - Canvas(GUI::Widget* parent, Settings& settings, + Canvas(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); // From Widget: - virtual void repaintEvent(GUI::RepaintEvent *repaintEvent) override; + virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override; void latencyEnabledChanged(bool enabled); void velocityEnabledChanged(bool enabled); @@ -69,10 +72,10 @@ private: void latencyLaidbackChanged(float laidback); void velocityStddevChanged(float stddev); - GUI::Texture stddev_h{getImageCache(), ":resources/stddev_horizontal.png"}; - GUI::Texture stddev_h_disabled{getImageCache(), ":resources/stddev_horizontal_disabled.png"}; - GUI::Texture stddev_v{getImageCache(), ":resources/stddev_vertical.png"}; - GUI::Texture stddev_v_disabled{getImageCache(), ":resources/stddev_vertical_disabled.png"}; + dggui::Texture stddev_h{getImageCache(), ":resources/stddev_horizontal.png"}; + dggui::Texture stddev_h_disabled{getImageCache(), ":resources/stddev_horizontal_disabled.png"}; + dggui::Texture stddev_v{getImageCache(), ":resources/stddev_vertical.png"}; + dggui::Texture stddev_v_disabled{getImageCache(), ":resources/stddev_vertical_disabled.png"}; bool latency_enabled{false}; bool velocity_enabled{false}; @@ -90,3 +93,5 @@ private: Canvas canvas; }; + +} // ::GUI diff --git a/plugingui/humanizerframecontent.cc b/plugingui/humanizerframecontent.cc index a4f71e5..aa36b7b 100644 --- a/plugingui/humanizerframecontent.cc +++ b/plugingui/humanizerframecontent.cc @@ -33,10 +33,10 @@ namespace GUI { -HumanizerframeContent::HumanizerframeContent(Widget* parent, +HumanizerframeContent::HumanizerframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , settings(settings) , settings_notifier(settings_notifier) { @@ -63,14 +63,14 @@ HumanizerframeContent::HumanizerframeContent(Widget* parent, stddev.setControl(&stddev_knob); layout.addItem(&stddev); - layout.setPosition(&attack, GridLayout::GridRange{0, 1, 0, 1}); - layout.setPosition(&falloff, GridLayout::GridRange{1, 2, 0, 1}); - layout.setPosition(&stddev, GridLayout::GridRange{2, 3, 0, 1}); + layout.setPosition(&attack, dggui::GridLayout::GridRange{0, 1, 0, 1}); + layout.setPosition(&falloff, dggui::GridLayout::GridRange{1, 2, 0, 1}); + layout.setPosition(&stddev, dggui::GridLayout::GridRange{2, 3, 0, 1}); CONNECT(this, settings_notifier.velocity_modifier_weight, - &attack_knob, &Knob::setValue); + &attack_knob, &dggui::Knob::setValue); CONNECT(this, settings_notifier.velocity_modifier_falloff, - &falloff_knob, &Knob::setValue); + &falloff_knob, &dggui::Knob::setValue); CONNECT(this, settings_notifier.velocity_stddev, this, &HumanizerframeContent::stddevSettingsValueChanged); diff --git a/plugingui/humanizerframecontent.h b/plugingui/humanizerframecontent.h index ef60b8e..4603132 100644 --- a/plugingui/humanizerframecontent.h +++ b/plugingui/humanizerframecontent.h @@ -41,10 +41,10 @@ namespace GUI { class HumanizerframeContent - : public Widget + : public dggui::Widget { public: - HumanizerframeContent(Widget* parent, + HumanizerframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); @@ -57,15 +57,15 @@ private: void stddevSettingsValueChanged(float value); - GridLayout layout{this, 3, 1}; + dggui::GridLayout layout{this, 3, 1}; LabeledControl attack{this, _("pAttack")}; // drummer strength LabeledControl falloff{this, _("pRelease")}; // regain LabeledControl stddev{this, _("pStdDev")}; - Knob attack_knob{&attack}; - Knob falloff_knob{&falloff}; - Knob stddev_knob{&stddev}; + dggui::Knob attack_knob{&attack}; + dggui::Knob falloff_knob{&falloff}; + dggui::Knob stddev_knob{&stddev}; Settings& settings; SettingsNotifier& settings_notifier; diff --git a/plugingui/labeledcontrol.h b/plugingui/labeledcontrol.h index 1972072..693f582 100644 --- a/plugingui/labeledcontrol.h +++ b/plugingui/labeledcontrol.h @@ -37,34 +37,34 @@ namespace GUI { class LabeledControl - : public Widget + : public dggui::Widget { public: using ValueTransformationFunction = std::function<std::string(float, float, float)>; - LabeledControl(Widget* parent, const std::string& name) - : Widget(parent) + LabeledControl(dggui::Widget* parent, const std::string& name) + : dggui::Widget(parent) { layout.setResizeChildren(false); - layout.setHAlignment(HAlignment::center); + layout.setHAlignment(dggui::HAlignment::center); layout.setSpacing(2); caption.setText(name); caption.resize(100, 20); - caption.setAlignment(TextAlignment::center); + caption.setAlignment(dggui::TextAlignment::center); layout.addItem(&caption); } - void setControl(Knob* control) + void setControl(dggui::Knob* control) { layout.addItem(control); CONNECT(control, valueChangedNotifier, this, &LabeledControl::setValue); setValue(control->value()); value.resize(100, 20); - value.setAlignment(TextAlignment::center); + value.setAlignment(dggui::TextAlignment::center); layout.addItem(&value); } @@ -77,9 +77,9 @@ public: float scale{1.0f}; private: - VBoxLayout layout{this}; - Label caption{this}; - Label value{this}; + dggui::VBoxLayout layout{this}; + dggui::Label caption{this}; + dggui::Label value{this}; ValueTransformationFunction value_transformation_func; diff --git a/plugingui/locale/da.po b/plugingui/locale/da.po index 3b74d56..e25235f 100644 --- a/plugingui/locale/da.po +++ b/plugingui/locale/da.po @@ -82,19 +82,19 @@ msgstr "" msgid "0 MB" msgstr "" -#: diskstreamingframecontent.cc:107 +#: diskstreamingframecontent.cc:109 msgid "Unlimited" msgstr "" -#: drumkitframecontent.cc:49 +#: drumkitframecontent.cc:48 msgid "Browse..." msgstr "" -#: drumkitframecontent.cc:96 +#: drumkitframecontent.cc:95 msgid "Drumkit file:" msgstr "" -#: drumkitframecontent.cc:97 +#: drumkitframecontent.cc:96 msgid "Midimap file:" msgstr "" @@ -467,15 +467,15 @@ msgstr "" msgid "About" msgstr "" -#: powerwidget.cc:52 +#: powerwidget.cc:55 msgid "Shelf" msgstr "" -#: powerwidget.cc:210 +#: powerwidget.cc:213 msgid "in" msgstr "" -#: powerwidget.cc:211 +#: powerwidget.cc:214 msgid "out" msgstr "" @@ -503,47 +503,47 @@ msgstr "" msgid "No" msgstr "" -#: statusframecontent.cc:72 +#: statusframecontent.cc:73 msgid "Drumkit status: " msgstr "" -#: statusframecontent.cc:74 +#: statusframecontent.cc:75 msgid "Drumkit name: " msgstr "" -#: statusframecontent.cc:75 +#: statusframecontent.cc:76 msgid "Drumkit description: " msgstr "" -#: statusframecontent.cc:77 +#: statusframecontent.cc:78 msgid "Session buffer size: " msgstr "" -#: statusframecontent.cc:78 +#: statusframecontent.cc:79 msgid "Number of underruns: " msgstr "" -#: statusframecontent.cc:79 +#: statusframecontent.cc:80 msgid "Messages:\n" msgstr "" -#: statusframecontent.cc:88 +#: statusframecontent.cc:89 msgid "No Kit Loaded" msgstr "" -#: statusframecontent.cc:91 statusframecontent.cc:133 +#: statusframecontent.cc:92 statusframecontent.cc:134 msgid "Loading..." msgstr "" -#: statusframecontent.cc:94 statusframecontent.cc:136 +#: statusframecontent.cc:95 statusframecontent.cc:137 msgid "Ready" msgstr "" -#: statusframecontent.cc:97 statusframecontent.cc:139 +#: statusframecontent.cc:98 statusframecontent.cc:140 msgid "Error" msgstr "" -#: statusframecontent.cc:130 +#: statusframecontent.cc:131 msgid "No Midimap Loaded" msgstr "" @@ -551,46 +551,46 @@ msgstr "" msgid "Per-instrument voice limit:" msgstr "" -#: humanizerframecontent.h:61 +#: humanizerframecontent.h:62 msgid "pAttack" msgstr "" -#: humanizerframecontent.h:62 +#: humanizerframecontent.h:63 msgid "pRelease" msgstr "" -#: humanizerframecontent.h:63 +#: humanizerframecontent.h:64 msgid "pStdDev" msgstr "" -#: sampleselectionframecontent.h:61 +#: sampleselectionframecontent.h:62 msgid "pClose" msgstr "" -#: sampleselectionframecontent.h:62 +#: sampleselectionframecontent.h:63 msgid "pDiverse" msgstr "" -#: sampleselectionframecontent.h:63 +#: sampleselectionframecontent.h:64 msgid "pRandom" msgstr "" -#: timingframecontent.h:73 +#: timingframecontent.h:74 msgid "pTightness" msgstr "" -#: timingframecontent.h:74 +#: timingframecontent.h:75 msgid "pTimingRegain" msgstr "" -#: timingframecontent.h:75 +#: timingframecontent.h:76 msgid "pLaidback" msgstr "" -#: voicelimitframecontent.h:66 +#: voicelimitframecontent.h:67 msgid "Max voices" msgstr "" -#: voicelimitframecontent.h:67 +#: voicelimitframecontent.h:68 msgid "Rampdown time" msgstr "" diff --git a/plugingui/locale/drumgizmo.pot b/plugingui/locale/drumgizmo.pot index 88023ab..72e600e 100644 --- a/plugingui/locale/drumgizmo.pot +++ b/plugingui/locale/drumgizmo.pot @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: drumgizmo 0.9.18.1\n" +"Project-Id-Version: drumgizmo 0.9.19\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" @@ -80,19 +80,19 @@ msgstr "" msgid "0 MB" msgstr "" -#: diskstreamingframecontent.cc:107 +#: diskstreamingframecontent.cc:109 msgid "Unlimited" msgstr "" -#: drumkitframecontent.cc:49 +#: drumkitframecontent.cc:48 msgid "Browse..." msgstr "" -#: drumkitframecontent.cc:96 +#: drumkitframecontent.cc:95 msgid "Drumkit file:" msgstr "" -#: drumkitframecontent.cc:97 +#: drumkitframecontent.cc:96 msgid "Midimap file:" msgstr "" @@ -465,15 +465,15 @@ msgstr "" msgid "About" msgstr "" -#: powerwidget.cc:52 +#: powerwidget.cc:55 msgid "Shelf" msgstr "" -#: powerwidget.cc:210 +#: powerwidget.cc:213 msgid "in" msgstr "" -#: powerwidget.cc:211 +#: powerwidget.cc:214 msgid "out" msgstr "" @@ -501,47 +501,47 @@ msgstr "" msgid "No" msgstr "" -#: statusframecontent.cc:72 +#: statusframecontent.cc:73 msgid "Drumkit status: " msgstr "" -#: statusframecontent.cc:74 +#: statusframecontent.cc:75 msgid "Drumkit name: " msgstr "" -#: statusframecontent.cc:75 +#: statusframecontent.cc:76 msgid "Drumkit description: " msgstr "" -#: statusframecontent.cc:77 +#: statusframecontent.cc:78 msgid "Session buffer size: " msgstr "" -#: statusframecontent.cc:78 +#: statusframecontent.cc:79 msgid "Number of underruns: " msgstr "" -#: statusframecontent.cc:79 +#: statusframecontent.cc:80 msgid "Messages:\n" msgstr "" -#: statusframecontent.cc:88 +#: statusframecontent.cc:89 msgid "No Kit Loaded" msgstr "" -#: statusframecontent.cc:91 statusframecontent.cc:133 +#: statusframecontent.cc:92 statusframecontent.cc:134 msgid "Loading..." msgstr "" -#: statusframecontent.cc:94 statusframecontent.cc:136 +#: statusframecontent.cc:95 statusframecontent.cc:137 msgid "Ready" msgstr "" -#: statusframecontent.cc:97 statusframecontent.cc:139 +#: statusframecontent.cc:98 statusframecontent.cc:140 msgid "Error" msgstr "" -#: statusframecontent.cc:130 +#: statusframecontent.cc:131 msgid "No Midimap Loaded" msgstr "" @@ -549,46 +549,46 @@ msgstr "" msgid "Per-instrument voice limit:" msgstr "" -#: humanizerframecontent.h:61 +#: humanizerframecontent.h:62 msgid "pAttack" msgstr "" -#: humanizerframecontent.h:62 +#: humanizerframecontent.h:63 msgid "pRelease" msgstr "" -#: humanizerframecontent.h:63 +#: humanizerframecontent.h:64 msgid "pStdDev" msgstr "" -#: sampleselectionframecontent.h:61 +#: sampleselectionframecontent.h:62 msgid "pClose" msgstr "" -#: sampleselectionframecontent.h:62 +#: sampleselectionframecontent.h:63 msgid "pDiverse" msgstr "" -#: sampleselectionframecontent.h:63 +#: sampleselectionframecontent.h:64 msgid "pRandom" msgstr "" -#: timingframecontent.h:73 +#: timingframecontent.h:74 msgid "pTightness" msgstr "" -#: timingframecontent.h:74 +#: timingframecontent.h:75 msgid "pTimingRegain" msgstr "" -#: timingframecontent.h:75 +#: timingframecontent.h:76 msgid "pLaidback" msgstr "" -#: voicelimitframecontent.h:66 +#: voicelimitframecontent.h:67 msgid "Max voices" msgstr "" -#: voicelimitframecontent.h:67 +#: voicelimitframecontent.h:68 msgid "Rampdown time" msgstr "" diff --git a/plugingui/locale/fr.po b/plugingui/locale/fr.po index a41db20..b46174c 100644 --- a/plugingui/locale/fr.po +++ b/plugingui/locale/fr.po @@ -102,19 +102,19 @@ msgstr "Appliquer" msgid "0 MB" msgstr "" -#: diskstreamingframecontent.cc:107 +#: diskstreamingframecontent.cc:109 msgid "Unlimited" msgstr "Illimité" -#: drumkitframecontent.cc:49 +#: drumkitframecontent.cc:48 msgid "Browse..." msgstr "Naviguer..." -#: drumkitframecontent.cc:96 +#: drumkitframecontent.cc:95 msgid "Drumkit file:" msgstr "Fichier de kit de batterie :" -#: drumkitframecontent.cc:97 +#: drumkitframecontent.cc:96 msgid "Midimap file:" msgstr "Fichier midimap :" @@ -452,8 +452,8 @@ msgid "" "This feature works on a per-instrument basis, e.g., voices played on the " "bass\n" msgstr "" -"Cette caractéristique fonctionne instrument par instrument, c'est-à-dire " -"que les\n" +"Cette caractéristique fonctionne instrument par instrument, c'est-à-dire que " +"les\n" #: maintab.cc:126 msgid "" @@ -467,13 +467,14 @@ msgid "" " * Max voices: The maximum number of voices that should be allowed to " "play.\n" msgstr "" -" * Voix max : le nombre maximum de voix qui peuvent être autorisées à jouer.\n" - +" * Voix max : le nombre maximum de voix qui peuvent être autorisées à " +"jouer.\n" #: maintab.cc:129 msgid " * Rampdown time: How many seconds it takes to silence a voice." msgstr "" -" * Durée de rampe : le nombre de secondes nécessaires pour silencer une voix." +" * Durée de rampe : le nombre de secondes nécessaires pour silencer une " +"voix." #: maintab.cc:134 mainwindow.cc:56 msgid "Drumkit" @@ -531,15 +532,15 @@ msgstr "Principal" msgid "About" msgstr "À propos" -#: powerwidget.cc:52 +#: powerwidget.cc:55 msgid "Shelf" msgstr "Plateau" -#: powerwidget.cc:210 +#: powerwidget.cc:213 msgid "in" msgstr "entrée" -#: powerwidget.cc:211 +#: powerwidget.cc:214 msgid "out" msgstr "sortie" @@ -567,47 +568,47 @@ msgstr "Oui" msgid "No" msgstr "Non" -#: statusframecontent.cc:72 +#: statusframecontent.cc:73 msgid "Drumkit status: " msgstr "Status du kit de batterie : " -#: statusframecontent.cc:74 +#: statusframecontent.cc:75 msgid "Drumkit name: " msgstr "Nom du kit de batterie : " -#: statusframecontent.cc:75 +#: statusframecontent.cc:76 msgid "Drumkit description: " msgstr "Description du kit de batterie : " -#: statusframecontent.cc:77 +#: statusframecontent.cc:78 msgid "Session buffer size: " msgstr "Taille du tampon de session : " -#: statusframecontent.cc:78 +#: statusframecontent.cc:79 msgid "Number of underruns: " msgstr "Nombre de désynchros : " -#: statusframecontent.cc:79 +#: statusframecontent.cc:80 msgid "Messages:\n" msgstr "Messages :\n" -#: statusframecontent.cc:88 +#: statusframecontent.cc:89 msgid "No Kit Loaded" msgstr "pas de kit chargé" -#: statusframecontent.cc:91 statusframecontent.cc:133 +#: statusframecontent.cc:92 statusframecontent.cc:134 msgid "Loading..." msgstr "Chargement..." -#: statusframecontent.cc:94 statusframecontent.cc:136 +#: statusframecontent.cc:95 statusframecontent.cc:137 msgid "Ready" msgstr "Prêt" -#: statusframecontent.cc:97 statusframecontent.cc:139 +#: statusframecontent.cc:98 statusframecontent.cc:140 msgid "Error" msgstr "Erreur" -#: statusframecontent.cc:130 +#: statusframecontent.cc:131 msgid "No Midimap Loaded" msgstr "Pas de midimap chargée" @@ -615,46 +616,46 @@ msgstr "Pas de midimap chargée" msgid "Per-instrument voice limit:" msgstr "Limite de voix par instrument :" -#: humanizerframecontent.h:61 +#: humanizerframecontent.h:62 msgid "pAttack" msgstr "pAttaque" -#: humanizerframecontent.h:62 +#: humanizerframecontent.h:63 msgid "pRelease" msgstr "pRelâche" -#: humanizerframecontent.h:63 +#: humanizerframecontent.h:64 msgid "pStdDev" msgstr "pDévStd" -#: sampleselectionframecontent.h:61 +#: sampleselectionframecontent.h:62 msgid "pClose" msgstr "pProche" -#: sampleselectionframecontent.h:62 +#: sampleselectionframecontent.h:63 msgid "pDiverse" msgstr "pDiversité" -#: sampleselectionframecontent.h:63 +#: sampleselectionframecontent.h:64 msgid "pRandom" msgstr "pAléatoire" -#: timingframecontent.h:73 +#: timingframecontent.h:74 msgid "pTightness" msgstr "pRaideur" -#: timingframecontent.h:74 +#: timingframecontent.h:75 msgid "pTimingRegain" msgstr "pRetourTiming" -#: timingframecontent.h:75 +#: timingframecontent.h:76 msgid "pLaidback" msgstr "pNonchalance" -#: voicelimitframecontent.h:66 +#: voicelimitframecontent.h:67 msgid "Max voices" msgstr "Voix max" -#: voicelimitframecontent.h:67 +#: voicelimitframecontent.h:68 msgid "Rampdown time" msgstr "Durée de rampe" diff --git a/plugingui/maintab.cc b/plugingui/maintab.cc index d6da057..5c5fd02 100644 --- a/plugingui/maintab.cc +++ b/plugingui/maintab.cc @@ -31,7 +31,7 @@ namespace GUI { -MainTab::MainTab(Widget* parent, +MainTab::MainTab(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier, Config& config) @@ -166,11 +166,11 @@ MainTab::MainTab(Widget* parent, bleedcontrol_frame.setEnabled(false); CONNECT(this, settings_notifier.enable_velocity_modifier, - &humanizer_frame, &FrameWidget::setOnSwitch); + &humanizer_frame, &dggui::FrameWidget::setOnSwitch); CONNECT(this, settings_notifier.enable_resampling, - &resampling_frame, &FrameWidget::setOnSwitch); + &resampling_frame, &dggui::FrameWidget::setOnSwitch); CONNECT(this, settings_notifier.has_bleed_control, - &bleedcontrol_frame, &FrameWidget::setEnabled); + &bleedcontrol_frame, &dggui::FrameWidget::setEnabled); CONNECT(&humanizer_frame, onSwitchChangeNotifier, this, &MainTab::humanizerOnChange); CONNECT(&bleedcontrol_frame, onSwitchChangeNotifier, @@ -182,7 +182,7 @@ MainTab::MainTab(Widget* parent, CONNECT(&bleedcontrol_frame, onEnabledChanged, &bleedcontrolframe_content, &BleedcontrolframeContent::setEnabled); CONNECT(&settings_notifier, enable_powermap, - &power_frame, &FrameWidget::setOnSwitch); + &power_frame, &dggui::FrameWidget::setOnSwitch); CONNECT(&power_frame, onSwitchChangeNotifier, this, &MainTab::powerOnChange); CONNECT(&voicelimit_frame, onSwitchChangeNotifier, @@ -192,10 +192,10 @@ MainTab::MainTab(Widget* parent, void MainTab::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); // DrumGizmo logo - Painter painter(*this); + dggui::Painter painter(*this); painter.clear(); painter.drawImage(width - logo.width(), height - logo.height(), logo); } @@ -230,18 +230,18 @@ void MainTab::voicelimitOnChange(bool status) settings.enable_voice_limit.store(status); } -void MainTab::add(std::string const& title, FrameWidget& frame, Widget& content, - std::size_t height, int column) +void MainTab::add(std::string const& title, dggui::FrameWidget& frame, + dggui::Widget& content, std::size_t height, int column) { layout.addItem(&frame); frame.setTitle(title); frame.setContent(&content); auto grid_start = layout.lastUsedRow(column) + 1; - auto range = GridLayout::GridRange{column, - column + 1, - grid_start, - grid_start + int(height)}; + auto range = dggui::GridLayout::GridRange{column, + column + 1, + grid_start, + grid_start + int(height)}; layout.setPosition(&frame, range); } diff --git a/plugingui/maintab.h b/plugingui/maintab.h index 74b970a..9050061 100644 --- a/plugingui/maintab.h +++ b/plugingui/maintab.h @@ -50,10 +50,10 @@ namespace GUI { class MainTab - : public Widget + : public dggui::Widget { public: - MainTab(Widget* parent, + MainTab(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier, Config& config); @@ -69,21 +69,21 @@ private: void powerOnChange(bool on); void voicelimitOnChange(bool status); - Image logo{":resources/logo.png"}; + dggui::Image logo{":resources/logo.png"}; - GridLayout layout{this, 2, 64}; + dggui::GridLayout layout{this, 2, 64}; - FrameWidget drumkit_frame{this, false}; - FrameWidget status_frame{this, false}; - FrameWidget diskstreaming_frame{this, false}; - FrameWidget bleedcontrol_frame{this, true}; - FrameWidget resampling_frame{this, true}; - FrameWidget humanizer_frame{this, true, true}; - FrameWidget timing_frame{this, true, true}; - FrameWidget sampleselection_frame{this, false, true}; - FrameWidget visualizer_frame{this, false, true}; - FrameWidget power_frame{this, true, true}; - FrameWidget voicelimit_frame{this, true, true}; + dggui::FrameWidget drumkit_frame{this, false}; + dggui::FrameWidget status_frame{this, false}; + dggui::FrameWidget diskstreaming_frame{this, false}; + dggui::FrameWidget bleedcontrol_frame{this, true}; + dggui::FrameWidget resampling_frame{this, true}; + dggui::FrameWidget humanizer_frame{this, true, true}; + dggui::FrameWidget timing_frame{this, true, true}; + dggui::FrameWidget sampleselection_frame{this, false, true}; + dggui::FrameWidget visualizer_frame{this, false, true}; + dggui::FrameWidget power_frame{this, true, true}; + dggui::FrameWidget voicelimit_frame{this, true, true}; DrumkitframeContent drumkitframe_content; StatusframeContent statusframe_content; @@ -97,8 +97,8 @@ private: PowerWidget powerframe_content; VoiceLimitFrameContent voicelimit_content; - void add(std::string const& title, FrameWidget& frame, Widget& content, - std::size_t height, int column); + void add(std::string const& title, dggui::FrameWidget& frame, + dggui::Widget& content, std::size_t height, int column); Settings& settings; SettingsNotifier& settings_notifier; diff --git a/plugingui/mainwindow.cc b/plugingui/mainwindow.cc index ea79cb5..a4ad7b5 100644 --- a/plugingui/mainwindow.cc +++ b/plugingui/mainwindow.cc @@ -38,7 +38,7 @@ namespace GUI { MainWindow::MainWindow(Settings& settings, void* native_window) - : Window(native_window) + : dggui::Window(native_window) , settings_notifier(settings) , main_tab(this, settings, settings_notifier, config) , drumkit_tab(this, settings, settings_notifier) @@ -81,14 +81,14 @@ bool MainWindow::processEvents() return true; } -void MainWindow::repaintEvent(RepaintEvent* repaintEvent) +void MainWindow::repaintEvent(dggui::RepaintEvent* repaintEvent) { if(!visible()) { return; } - Painter painter(*this); + dggui::Painter painter(*this); auto bar_height = tabs.getBarHeight(); diff --git a/plugingui/mainwindow.h b/plugingui/mainwindow.h index efacf07..ae0da8b 100644 --- a/plugingui/mainwindow.h +++ b/plugingui/mainwindow.h @@ -42,7 +42,7 @@ namespace GUI { class MainWindow - : public Window + : public dggui::Window { public: @@ -65,31 +65,31 @@ private: void changeDrumkitTabVisibility(bool visible); // From Widget - void repaintEvent(RepaintEvent* repaintEvent) override final; + void repaintEvent(dggui::RepaintEvent* repaintEvent) override final; Config config; SettingsNotifier settings_notifier; - TabWidget tabs{this}; + dggui::TabWidget tabs{this}; MainTab main_tab; DrumkitTab drumkit_tab; AboutTab about_tab{&tabs}; - Image back{":resources/bg.png"}; + dggui::Image back{":resources/bg.png"}; - TexturedBox sidebar{getImageCache(), ":resources/sidebar.png", + dggui::TexturedBox sidebar{getImageCache(), ":resources/sidebar.png", 0, 0, // offset 16, 0, 0, // delta-x 14, 1, 14}; // delta-y - TexturedBox topbar{getImageCache(), ":resources/topbar.png", + dggui::TexturedBox topbar{getImageCache(), ":resources/topbar.png", 0, 0, // atlas offset (x, y) 1, 1, 1, // dx1, dx2, dx3 17, 1, 1}; // dy1, dy2, dy3 bool closing{false}; - TabID drumkit_tab_id; + dggui::TabID drumkit_tab_id; }; } // GUI:: diff --git a/plugingui/powerwidget.cc b/plugingui/powerwidget.cc index 301f396..9be0c48 100644 --- a/plugingui/powerwidget.cc +++ b/plugingui/powerwidget.cc @@ -38,10 +38,13 @@ #include <translation.h> -PowerWidget::PowerWidget(GUI::Widget* parent, +namespace GUI +{ + +PowerWidget::PowerWidget(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : GUI::Widget(parent) + : dggui::Widget(parent) , canvas(this, settings, settings_notifier) , settings(settings) { @@ -50,12 +53,12 @@ PowerWidget::PowerWidget(GUI::Widget* parent, CONNECT(&shelf_checkbox, stateChangedNotifier, this, &PowerWidget::chk_shelf); shelf_label.setText(_("Shelf")); - shelf_label.setAlignment(GUI::TextAlignment::center); + shelf_label.setAlignment(dggui::TextAlignment::center); shelf_label.resize(59, 16); shelf_checkbox.resize(59, 40); CONNECT(&settings_notifier, powermap_shelf, &shelf_checkbox, - &GUI::CheckBox::setChecked); + &dggui::CheckBox::setChecked); } void PowerWidget::chk_shelf(bool v) @@ -63,9 +66,9 @@ void PowerWidget::chk_shelf(bool v) settings.powermap_shelf.store(v); } -void PowerWidget::repaintEvent(GUI::RepaintEvent *repaintEvent) +void PowerWidget::repaintEvent(dggui::RepaintEvent *repaintEvent) { - GUI::Painter p(*this); + dggui::Painter p(*this); box.setSize(width() - 59 - 64, height()); p.drawImage(0, 0, box); } @@ -84,10 +87,10 @@ void PowerWidget::resize(std::size_t width, std::size_t height) shelf_checkbox.move(width - 59 + 5 - 32, 16); } -PowerWidget::Canvas::Canvas(GUI::Widget* parent, +PowerWidget::Canvas::Canvas(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : GUI::Widget(parent) + : dggui::Widget(parent) , settings_notifier(settings_notifier) , settings(settings) { @@ -115,7 +118,7 @@ PowerWidget::Canvas::Canvas(GUI::Widget* parent, parameterChangedFloat(0); } -void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) +void PowerWidget::Canvas::repaintEvent(dggui::RepaintEvent *repaintEvent) { if(width() < 1 || height() < 1) { @@ -127,29 +130,29 @@ void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) const float width0 = (int)width() - 2 * brd; const float height0 = (int)height() - 2 * brd; - GUI::Painter p(*this); + dggui::Painter p(*this); p.clear(); - p.setColour(GUI::Colour(1.0f, 1.0f, 1.0f, 0.2f)); + p.setColour(dggui::Colour(1.0f, 1.0f, 1.0f, 0.2f)); p.drawRectangle(x0, y0 + height0, x0 + width0, y0); if(enabled) { // draw 1:1 line in grey in the background to indicate where 1:1 is - p.setColour(GUI::Colour(0.5)); + p.setColour(dggui::Colour(0.5)); p.drawLine(x0, y0 + height0, x0 + width0, y0); } if(enabled) { // enabled green - p.setColour(GUI::Colour(0.0f, 1.0f, 0.0f, 1.0f)); + p.setColour(dggui::Colour(0.0f, 1.0f, 0.0f, 1.0f)); } else { // disabled grey - p.setColour(GUI::Colour(0.5f)); + p.setColour(dggui::Colour(0.5f)); } // Draw very short line segments across the region @@ -172,14 +175,14 @@ void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) if(!enabled) { // draw 1:1 line in green in the foreground - p.setColour(GUI::Colour(0.0f, 1.0f, 0.0f, 1.0f)); + p.setColour(dggui::Colour(0.0f, 1.0f, 0.0f, 1.0f)); p.drawLine(x0, y0 + height0, x0 + width0, y0); } // draw the input/output of the last hit if(settings.powermap_input.load() != -1 && settings.powermap_output.load() != -1) { - p.setColour(GUI::Colour(.8f, 0.0f, .2f, .5f)); + p.setColour(dggui::Colour(.8f, 0.0f, .2f, .5f)); p.drawLine(x0 + settings.powermap_input.load()*width0, y0 + height0, x0 + settings.powermap_input.load()*width0, y0); p.drawLine(x0, y0 + height0 - settings.powermap_output.load()*height0, @@ -188,30 +191,30 @@ void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) // draw the fixed nodes of the spline float rad = radius * width(); - p.setColour(GUI::Colour{0.0f, 1.0f, 0.0f, 0.7f}); + p.setColour(dggui::Colour{0.0f, 1.0f, 0.0f, 0.7f}); p.drawFilledCircle(x0 + std::round(settings.powermap_fixed0_x.load() * width0), y0 + height0 - std::round(settings.powermap_fixed0_y.load() * height0), rad); p.drawCircle(x0 + std::round(power_map.getFixed0().in * width0), y0 + height0 - std::round(power_map.getFixed0().out * height0), rad + 1); - p.setColour(GUI::Colour{1.0f, 1.0f, 0.0f, 0.7f}); + p.setColour(dggui::Colour{1.0f, 1.0f, 0.0f, 0.7f}); p.drawFilledCircle(x0 + std::round(settings.powermap_fixed1_x.load() * width0), y0 + height0 - std::round(settings.powermap_fixed1_y.load() * height0), rad); p.drawCircle(x0 + std::round(power_map.getFixed1().in * width0), y0 + height0 - std::round(power_map.getFixed1().out * height0), rad + 1); - p.setColour(GUI::Colour{1.0f, 0.0f, 0.0f, 0.7f}); + p.setColour(dggui::Colour{1.0f, 0.0f, 0.0f, 0.7f}); p.drawFilledCircle(x0 + std::round(settings.powermap_fixed2_x.load() * width0), y0 + height0 - std::round(settings.powermap_fixed2_y.load() * height0), rad); p.drawCircle(x0 + std::round(power_map.getFixed2().in * width0), y0 + height0 - std::round(power_map.getFixed2().out * height0), rad + 1); - p.setColour(GUI::Colour(1.0f, 1.0f, 1.0f, 0.2f)); + p.setColour(dggui::Colour(1.0f, 1.0f, 1.0f, 0.2f)); p.drawText(width() / 2 - (font.textWidth(_("in")) / 2), height() - 8, font, _("in")); p.drawText(8, height() / 2 - (font.textWidth(_("out")) / 2), font, _("out"), false, true); } -void PowerWidget::Canvas::buttonEvent(GUI::ButtonEvent* buttonEvent) +void PowerWidget::Canvas::buttonEvent(dggui::ButtonEvent* buttonEvent) { const float x0 = brd; const float y0 = brd; @@ -226,10 +229,10 @@ void PowerWidget::Canvas::buttonEvent(GUI::ButtonEvent* buttonEvent) switch(buttonEvent->direction) { - case GUI::Direction::up: + case dggui::Direction::up: in_point = -1; break; - case GUI::Direction::down: + case dggui::Direction::down: if(std::abs(mx0 - settings.powermap_fixed0_x.load()) < radius_x && std::abs(my0 - settings.powermap_fixed0_y.load()) < radius_y) { @@ -259,7 +262,7 @@ float clamp(float val, float min, float max) } } -void PowerWidget::Canvas::mouseMoveEvent(GUI::MouseMoveEvent* mouseMoveEvent) +void PowerWidget::Canvas::mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent) { const float x0 = brd; const float y0 = brd; @@ -332,3 +335,5 @@ void PowerWidget::Canvas::parameterChangedBool(bool) { parameterChangedFloat(0); } + +} // ::GUI diff --git a/plugingui/powerwidget.h b/plugingui/powerwidget.h index 8398f75..3a7bb8e 100644 --- a/plugingui/powerwidget.h +++ b/plugingui/powerwidget.h @@ -39,36 +39,39 @@ struct Settings; class SettingsNotifier; +namespace GUI +{ + class PowerWidget - : public GUI::Widget + : public dggui::Widget { public: - PowerWidget(GUI::Widget* parent, + PowerWidget(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); // From Widget: - virtual void repaintEvent(GUI::RepaintEvent *repaintEvent) override; + virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override; virtual void resize(std::size_t width, std::size_t height) override; private: - GUI::TexturedBox box{getImageCache(), ":resources/widget.png", + dggui::TexturedBox box{getImageCache(), ":resources/widget.png", 0, 0, // atlas offset (x, y) 7, 1, 7, // dx1, dx2, dx3 7, 63, 7}; // dy1, dy2, dy3 class Canvas - : public GUI::Widget + : public dggui::Widget { public: - Canvas(GUI::Widget* parent, Settings& settings, + Canvas(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); // From Widget: virtual bool catchMouse() override { return true; } - virtual void repaintEvent(GUI::RepaintEvent *repaintEvent) override; - virtual void buttonEvent(GUI::ButtonEvent* buttonEvent) override; - virtual void mouseMoveEvent(GUI::MouseMoveEvent* mouseMoveEvent) override; + virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override; + virtual void buttonEvent(dggui::ButtonEvent* buttonEvent) override; + virtual void mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent) override; virtual void mouseLeaveEvent() override; private: @@ -85,14 +88,16 @@ private: int in_point{-1}; const float radius = 0.02f; const float brd = 6.0f; - GUI::Font font{":resources/fontemboss.png"}; + dggui::Font font{":resources/fontemboss.png"}; }; void chk_shelf(bool v); Canvas canvas; - GUI::Label shelf_label{this}; - GUI::CheckBox shelf_checkbox{this}; + dggui::Label shelf_label{this}; + dggui::CheckBox shelf_checkbox{this}; Settings& settings; }; + +} // ::GUI diff --git a/plugingui/resamplingframecontent.cc b/plugingui/resamplingframecontent.cc index 035781f..d92dc27 100644 --- a/plugingui/resamplingframecontent.cc +++ b/plugingui/resamplingframecontent.cc @@ -33,10 +33,10 @@ namespace GUI { -ResamplingframeContent::ResamplingframeContent(Widget* parent, +ResamplingframeContent::ResamplingframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , settings(settings) , settings_notifier(settings_notifier) { @@ -57,7 +57,7 @@ ResamplingframeContent::ResamplingframeContent(Widget* parent, quality_knob.showValue(false); quality_label.setText(_("Quality")); - quality_label.setAlignment(TextAlignment::center); + quality_label.setAlignment(dggui::TextAlignment::center); quality_label.resize(40, 16); CONNECT(&quality_knob, valueChangedNotifier, diff --git a/plugingui/resamplingframecontent.h b/plugingui/resamplingframecontent.h index e66bec5..3bdddc6 100644 --- a/plugingui/resamplingframecontent.h +++ b/plugingui/resamplingframecontent.h @@ -38,10 +38,10 @@ namespace GUI { class ResamplingframeContent - : public Widget + : public dggui::Widget { public: - ResamplingframeContent(Widget* parent, + ResamplingframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); @@ -58,9 +58,9 @@ private: void valueChangedNotifier(float value); private: - TextEdit text_field{this}; - Knob quality_knob{this}; - Label quality_label{this}; + dggui::TextEdit text_field{this}; + dggui::Knob quality_knob{this}; + dggui::Label quality_label{this}; Settings& settings; SettingsNotifier& settings_notifier; diff --git a/plugingui/sampleselectionframecontent.cc b/plugingui/sampleselectionframecontent.cc index a647144..61b816f 100644 --- a/plugingui/sampleselectionframecontent.cc +++ b/plugingui/sampleselectionframecontent.cc @@ -33,10 +33,10 @@ namespace GUI { -SampleselectionframeContent::SampleselectionframeContent(Widget* parent, +SampleselectionframeContent::SampleselectionframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , settings(settings) , settings_notifier(settings_notifier) { @@ -63,9 +63,9 @@ SampleselectionframeContent::SampleselectionframeContent(Widget* parent, f_random.setControl(&f_random_knob); layout.addItem(&f_random); - layout.setPosition(&f_close, GridLayout::GridRange{0, 1, 0, 1}); - layout.setPosition(&f_diverse, GridLayout::GridRange{1, 2, 0, 1}); - layout.setPosition(&f_random, GridLayout::GridRange{2, 3, 0, 1}); + layout.setPosition(&f_close, dggui::GridLayout::GridRange{0, 1, 0, 1}); + layout.setPosition(&f_diverse, dggui::GridLayout::GridRange{1, 2, 0, 1}); + layout.setPosition(&f_random, dggui::GridLayout::GridRange{2, 3, 0, 1}); CONNECT(this, settings_notifier.sample_selection_f_close, this, &SampleselectionframeContent::fCloseSettingsValueChanged); diff --git a/plugingui/sampleselectionframecontent.h b/plugingui/sampleselectionframecontent.h index d56f545..ab1be04 100644 --- a/plugingui/sampleselectionframecontent.h +++ b/plugingui/sampleselectionframecontent.h @@ -41,10 +41,10 @@ namespace GUI { class SampleselectionframeContent - : public Widget + : public dggui::Widget { public: - SampleselectionframeContent(Widget* parent, + SampleselectionframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); @@ -57,15 +57,15 @@ private: void fDiverseSettingsValueChanged(float value); void fRandomSettingsValueChanged(float value); - GridLayout layout{this, 3, 1}; + dggui::GridLayout layout{this, 3, 1}; LabeledControl f_close{this, _("pClose")}; LabeledControl f_diverse{this, _("pDiverse")}; LabeledControl f_random{this, _("pRandom")}; - Knob f_close_knob{&f_close}; - Knob f_diverse_knob{&f_diverse}; - Knob f_random_knob{&f_random}; + dggui::Knob f_close_knob{&f_close}; + dggui::Knob f_diverse_knob{&f_diverse}; + dggui::Knob f_random_knob{&f_random}; Settings& settings; SettingsNotifier& settings_notifier; diff --git a/plugingui/statusframecontent.cc b/plugingui/statusframecontent.cc index 3152dfd..0fe8bf2 100644 --- a/plugingui/statusframecontent.cc +++ b/plugingui/statusframecontent.cc @@ -31,9 +31,10 @@ namespace GUI { -StatusframeContent::StatusframeContent(Widget* parent, +StatusframeContent::StatusframeContent(dggui::Widget* parent, SettingsNotifier& settings_notifier) - : Widget(parent), settings_notifier(settings_notifier) + : dggui::Widget(parent) + , settings_notifier(settings_notifier) { CONNECT(this, settings_notifier.drumkit_load_status, this, &StatusframeContent::updateDrumkitLoadStatus); @@ -62,7 +63,7 @@ StatusframeContent::StatusframeContent(Widget* parent, void StatusframeContent::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); text_field.resize(width, height); } diff --git a/plugingui/statusframecontent.h b/plugingui/statusframecontent.h index fdf6d05..55f7a16 100644 --- a/plugingui/statusframecontent.h +++ b/plugingui/statusframecontent.h @@ -36,10 +36,12 @@ class SettingsNotifier; namespace GUI { -class StatusframeContent : public Widget +class StatusframeContent + : public dggui::Widget { public: - StatusframeContent(Widget* parent, SettingsNotifier& settings_notifier); + StatusframeContent(dggui::Widget* parent, + SettingsNotifier& settings_notifier); // From Widget virtual void resize(std::size_t width, std::size_t height) override; @@ -56,7 +58,7 @@ public: void loadStatusTextChanged(const std::string& text); private: - TextEdit text_field{this}; + dggui::TextEdit text_field{this}; SettingsNotifier& settings_notifier; diff --git a/plugingui/testmain.cc b/plugingui/testmain.cc index 4b94083..0ac3bc5 100644 --- a/plugingui/testmain.cc +++ b/plugingui/testmain.cc @@ -40,14 +40,14 @@ int main() { #ifdef WITH_NLS - UITranslation translation; + dggui::UITranslation translation; #endif // WITH_NLS INFO(example, "We are up and running"); void* native_window_handle{nullptr}; #ifndef UI_PUGL - GUI::Window parent{nullptr}; + dggui::Window parent{nullptr}; parent.setCaption("PluginGui Test Application"); native_window_handle = parent.getNativeWindowHandle(); #endif @@ -57,7 +57,7 @@ int main() #ifndef UI_PUGL CONNECT(&parent, eventHandler()->closeNotifier, &main_window, - &GUI::MainWindow::closeEventHandler); + &GUI::MainWindow::closeEventHandler); parent.show(); #endif diff --git a/plugingui/timingframecontent.cc b/plugingui/timingframecontent.cc index ffcd07e..18784f0 100644 --- a/plugingui/timingframecontent.cc +++ b/plugingui/timingframecontent.cc @@ -34,10 +34,10 @@ namespace GUI { -TimingframeContent::TimingframeContent(Widget* parent, +TimingframeContent::TimingframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , settings(settings) , settings_notifier(settings_notifier) { @@ -65,9 +65,9 @@ TimingframeContent::TimingframeContent(Widget* parent, laidback.setControl(&laidback_knob); layout.addItem(&laidback); - layout.setPosition(&tightness, GridLayout::GridRange{0, 1, 0, 1}); - layout.setPosition(®ain, GridLayout::GridRange{1, 2, 0, 1}); - layout.setPosition(&laidback, GridLayout::GridRange{2, 3, 0, 1}); + layout.setPosition(&tightness, dggui::GridLayout::GridRange{0, 1, 0, 1}); + layout.setPosition(®ain, dggui::GridLayout::GridRange{1, 2, 0, 1}); + layout.setPosition(&laidback, dggui::GridLayout::GridRange{2, 3, 0, 1}); CONNECT(this, settings_notifier.latency_stddev, this, &TimingframeContent::tightnessSettingsValueChanged); diff --git a/plugingui/timingframecontent.h b/plugingui/timingframecontent.h index adecc01..4dfa974 100644 --- a/plugingui/timingframecontent.h +++ b/plugingui/timingframecontent.h @@ -46,10 +46,10 @@ namespace GUI { class TimingframeContent - : public Widget + : public dggui::Widget { public: - TimingframeContent(Widget* parent, + TimingframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); @@ -69,15 +69,15 @@ private: void latencyOffsetChanged(int offset); void velocityOffsetChanged(float offset); - GridLayout layout{this, 3, 1}; + dggui::GridLayout layout{this, 3, 1}; LabeledControl tightness{this, _("pTightness")}; LabeledControl regain{this, _("pTimingRegain")}; LabeledControl laidback{this, _("pLaidback")}; - Knob tightness_knob{&tightness}; - Knob regain_knob{®ain}; - Knob laidback_knob{&laidback}; + dggui::Knob tightness_knob{&tightness}; + dggui::Knob regain_knob{®ain}; + dggui::Knob laidback_knob{&laidback}; Settings& settings; SettingsNotifier& settings_notifier; diff --git a/plugingui/visualizerframecontent.cc b/plugingui/visualizerframecontent.cc index d6ea2c2..3404bec 100644 --- a/plugingui/visualizerframecontent.cc +++ b/plugingui/visualizerframecontent.cc @@ -34,17 +34,17 @@ namespace GUI { -VisualizerframeContent::VisualizerframeContent(Widget* parent, +VisualizerframeContent::VisualizerframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , visualizer(this, settings, settings_notifier) { } void VisualizerframeContent::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + dggui::Widget::resize(width, height); visualizer.resize(width, height); } diff --git a/plugingui/visualizerframecontent.h b/plugingui/visualizerframecontent.h index 3012762..abf54c4 100644 --- a/plugingui/visualizerframecontent.h +++ b/plugingui/visualizerframecontent.h @@ -42,10 +42,10 @@ namespace GUI { class VisualizerframeContent - : public Widget + : public dggui::Widget { public: - VisualizerframeContent(Widget* parent, Settings& settings, + VisualizerframeContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); // From Widget diff --git a/plugingui/voicelimitframecontent.cc b/plugingui/voicelimitframecontent.cc index c7c8c28..00036a0 100644 --- a/plugingui/voicelimitframecontent.cc +++ b/plugingui/voicelimitframecontent.cc @@ -30,25 +30,25 @@ namespace GUI { -VoiceLimitFrameContent::VoiceLimitFrameContent(Widget* parent, +VoiceLimitFrameContent::VoiceLimitFrameContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier) - : Widget(parent) + : dggui::Widget(parent) , settings(settings) , settings_notifier(settings_notifier) { //Setup frame. label_text.setText(_("Per-instrument voice limit:")); - label_text.setAlignment(TextAlignment::center); + label_text.setAlignment(dggui::TextAlignment::center); //Setup layout layout.setResizeChildren(false); auto setup_control = - [](Knob& knob, + [](dggui::Knob& knob, LabeledControl& label, - GridLayout& layout, - const GridLayout::GridRange& gridrange, + dggui::GridLayout& layout, + const dggui::GridLayout::GridRange& gridrange, float min, float max, float defaultval) diff --git a/plugingui/voicelimitframecontent.h b/plugingui/voicelimitframecontent.h index 0fbc306..2ea1978 100644 --- a/plugingui/voicelimitframecontent.h +++ b/plugingui/voicelimitframecontent.h @@ -41,10 +41,10 @@ namespace GUI { class VoiceLimitFrameContent - : public Widget + : public dggui::Widget { public: - VoiceLimitFrameContent(Widget* parent, + VoiceLimitFrameContent(dggui::Widget* parent, Settings& settings, SettingsNotifier& settings_notifier); @@ -60,15 +60,15 @@ private: Settings& settings; SettingsNotifier& settings_notifier; - Label label_text{this}; + dggui::Label label_text{this}; - GridLayout layout{this, 2, 1}; + dggui::GridLayout layout{this, 2, 1}; LabeledControl lc_max_voices{this, _("Max voices")}; LabeledControl lc_rampdown_time{this, _("Rampdown time")}; - Knob knob_max_voices{&lc_max_voices}; - Knob knob_rampdown_time{&lc_rampdown_time}; + dggui::Knob knob_max_voices{&lc_max_voices}; + dggui::Knob knob_rampdown_time{&lc_rampdown_time}; }; } // GUI:: |