Rotateable::Rotateable(): axis(-M_PI/4), maxdecl(M_PI/4) { dragging = false; working = false; scrolling = false; modifier = 0; current_axis = axis; signal_button_press_event().connect(sigc::mem_fun(*this, &Rotateable::on_click)); signal_motion_notify_event().connect(sigc::mem_fun(*this, &Rotateable::on_motion)); signal_button_release_event().connect(sigc::mem_fun(*this, &Rotateable::on_release)); signal_scroll_event().connect(sigc::mem_fun(*this, &Rotateable::on_scroll)); }
SamplerWidget::SamplerWidget() { //std::cout << "SamplerWidget()" << std::endl; set_size_request(200, 150); // set initial volume volume = 0.8; // initial pan: -1.0 = left 1.0 = right 0.0 = center pan = 0.0; loopSampleBool = false; padOff(); // let this widget recieve these events add_events( Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK |Gdk::SCROLL_MASK); // Handle the signals of the events by callback funtcions signal_scroll_event().connect( sigc::mem_fun( *this, &SamplerWidget::onScrollEvent ) ); signal_button_press_event().connect(sigc::mem_fun(*this, &SamplerWidget::on_button_press_event) ); signal_button_release_event().connect(sigc::mem_fun(*this, &SamplerWidget::on_button_release_event) ); }