Exemplo n.º 1
0
void
perfroll::update_sizes ()
{
    int h_bars = m_roll_length_ticks / (m_ticks_per_bar);
    int h_bars_visible = (m_window_x * m_perf_scale_x) / (m_ticks_per_bar);
    int h_max_value = h_bars - h_bars_visible;
    m_hadjust.set_lower(0);
    m_hadjust.set_upper(h_bars);
    m_hadjust.set_page_size(h_bars_visible);
    m_hadjust.set_step_increment(1);
    m_hadjust.set_page_increment(1);
    if (m_hadjust.get_value() > h_max_value)
        m_hadjust.set_value(h_max_value);

    m_vadjust.set_lower(0);
    m_vadjust.set_upper(m_sequence_max);
    m_vadjust.set_page_size(m_window_y / m_names_y);
    m_vadjust.set_step_increment(1);
    m_vadjust.set_page_increment(1);

    int v_max_value = m_sequence_max - (m_window_y / m_names_y);
    if (m_vadjust.get_value() > v_max_value)
        m_vadjust.set_value(v_max_value);

    if (is_realized())
        m_pixmap = Gdk::Pixmap::create(m_window, m_window_x, m_window_y, -1);

    queue_draw();
}
Exemplo n.º 2
0
void ScreenAreaGl::vDrawBlackScreen()
{
  if (m_puiPixels && is_realized())
  {
    memset(m_puiPixels, 0, m_iHeight * (m_iWidth + 1) * sizeof(u32));
    queue_draw_area(0, 0, get_width(), get_height());
  }
}
Exemplo n.º 3
0
void
seqdata::update_sizes ()
{
    if (is_realized())
    {
        m_pixmap = Gdk::Pixmap::create(m_window, m_window_x, m_window_y, -1);
        redraw();
    }
}
Exemplo n.º 4
0
void
seqtime::update_sizes ()
{
    if (is_realized())                                  /* set this for later */
    {
        m_pixmap = Gdk::Pixmap::create(m_window, m_window_x, m_window_y, -1);
        update_pixmap();
        queue_draw();
    }
}
Exemplo n.º 5
0
void
perfroll::set_guides (int a_snap, int a_measure, int a_beat)
{
    m_snap = a_snap;
    m_measure_length = a_measure;
    m_beat_length = a_beat;
    if (is_realized())
        fill_background_pixmap();

    queue_draw();
}
Exemplo n.º 6
0
void ScreenAreaGl::vOnSizeUpdated()
{
  if (!is_realized())
    return;

  Glib::RefPtr<Gdk::GL::Window> glwindow = get_gl_window();
  if (!glwindow->gl_begin(get_gl_context()))
    return;

  vUpdateTexture();

  glwindow->gl_end();
}
void OSGDrawingArea::on_size_allocate (Gtk::Allocation& pAllocation)
{
#ifdef DEBUG
    //??std::cout <<"void OSGDrawingArea::on_size_allocate (Gtk::Allocation& pAllocation)<<"<< std::endl;
#endif
    set_allocation (pAllocation);
    if (is_realized ())
    {
        get_window ()->move_resize (pAllocation.get_x (), pAllocation.get_y (),
            pAllocation.get_width (), pAllocation.get_height ());
    }//if
#ifdef DEBUG
    //??std::cout <<"void OSGDrawingArea::on_size_allocate (Gtk::Allocation& pAllocation)>>"<< std::endl;
#endif
}
Exemplo n.º 8
0
void
seqroll::update_sizes ()
{
    m_hadjust->set_lower(0);                            /* set default size */
    m_hadjust->set_upper(m_seq->get_length());
    m_hadjust->set_page_size(m_window_x * m_zoom);

    /*
     * The horizontal step increment is 1 semiquaver (1/16) note per zoom
     * level.
     */

    m_hadjust->set_step_increment((c_ppqn / 4) * m_zoom);

    /*
     * The page increment is always one bar.
     */

    int page_increment = int
    (
        double(c_ppqn) * double(m_seq->get_bpm()) * (4.0 / double(m_seq->get_bw()))
    );
    m_hadjust->set_page_increment(page_increment);

    int h_max_value = (m_seq->get_length() - (m_window_x * m_zoom));
    if (m_hadjust->get_value() > h_max_value)
        m_hadjust->set_value(h_max_value);

    m_vadjust->set_lower(0);
    m_vadjust->set_upper(c_num_keys);
    m_vadjust->set_page_size(m_window_y / c_key_y);
    m_vadjust->set_step_increment(12);
    m_vadjust->set_page_increment(12);

    int v_max_value = c_num_keys - (m_window_y / c_key_y);
    if (m_vadjust->get_value() > v_max_value)
    {
        m_vadjust->set_value(v_max_value);
    }
    if (is_realized())              /* create pixmaps with window dimentions */
    {
        m_pixmap = Gdk::Pixmap::create(m_window, m_window_x, m_window_y, -1);
        m_background = Gdk::Pixmap::create(m_window, m_window_x, m_window_y, -1);
        change_vert();
    }
}
void OSGDrawingArea::onResizeInternal (Gtk::Allocation& pAllocation)
{
#ifdef DEBUG
    //??std::cout <<"void OSGDrawingArea::onResizeInternal (Gtk::Allocation& pAllocation)<<"<< std::endl;
#endif // DEBUG

    if (!is_realized ())
        return;

    if (!beginGL ())
        return;

    onResize (pAllocation);

    endGL ();

#ifdef DEBUG
    //??std::cout <<"void OSGDrawingArea::onResizeInternal (Gtk::Allocation& pAllocation)>>"<< std::endl;
#endif // DEBUG
}
Exemplo n.º 10
0
void
perfroll::update_sizes()
{
    int h_bars         = m_roll_length_ticks / (c_ppqn * 16);
    int h_bars_visable = (m_window_x * m_perf_scale_x) / (c_ppqn * 16);

    m_hadjust->set_lower( 0 );
    m_hadjust->set_upper( h_bars );
    m_hadjust->set_page_size( h_bars_visable );
    m_hadjust->set_step_increment( 1 );
    m_hadjust->set_page_increment( 1 );

    int h_max_value = h_bars - h_bars_visable;

    if ( m_hadjust->get_value() > h_max_value )
    {
        m_hadjust->set_value( h_max_value );
    }

    m_vadjust->set_lower( 0 );
    m_vadjust->set_upper( c_total_seqs );
    m_vadjust->set_page_size( m_window_y / c_names_y );
    m_vadjust->set_step_increment( 1 );
    m_vadjust->set_page_increment( 1 );

    int v_max_value = c_total_seqs - (m_window_y / c_names_y);

    if ( m_vadjust->get_value() > v_max_value )
    {
        m_vadjust->set_value(v_max_value);
    }

    if ( is_realized() )
    {
        m_pixmap = Gdk::Pixmap::create( m_window,
                                        m_window_x,
                                        m_window_y, -1 );
    }

    queue_draw();
}
Exemplo n.º 11
0
void
perfedit::draw_sequences ()
{
    if (is_realized())
        m_perfnames->draw_sequences();
}