~ubuntu-branches/ubuntu/karmic/rosegarden/karmic

« back to all changes in this revision

Viewing changes to src/gui/editors/segment/TrackButtons.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-05-02 00:33:44 UTC
  • mfrom: (1.1.7 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080502003344-67vbfhgqx2yl0ksi
Tags: 1:1.7.0-1ubuntu1
* Merge from Debian unstable. (LP: #225849) Remaining Ubuntu changes:
  - Add usr/share/doc/kde/HTML to rosegarden-data, to provide online
    help documentation.
  - Change fftw3-dev to libfftw3-dev.
  - Update maintainer field as per spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    Rosegarden
5
5
    A MIDI and audio sequencer and musical notation editor.
6
6
 
7
 
    This program is Copyright 2000-2007
 
7
    This program is Copyright 2000-2008
8
8
        Guillaume Laurent   <glaurent@telegraph-road.org>,
9
9
        Chris Cannam        <cannam@all-day-breakfast.com>,
10
10
        Richard Bown        <richard.bown@ferventsoftware.com>
284
284
    unsigned int newNbTracks = comp.getNbTracks();
285
285
    Track *track = 0;
286
286
 
 
287
    std::cerr << "TrackButtons::slotUpdateTracks" << std::endl;
 
288
 
287
289
    if (newNbTracks < m_tracks) {
288
290
        for (unsigned int i = m_tracks; i > newNbTracks; --i)
289
291
            removeButtons(i - 1);
303
305
        }
304
306
    }
305
307
 
 
308
    // Set height
 
309
    //
 
310
    for (unsigned int i = 0; i < m_trackHBoxes.size(); ++i) {
 
311
 
 
312
        track = comp.getTrackByPosition(i);
 
313
 
 
314
        if (track) {
 
315
            
 
316
            int multiple = m_doc->getComposition()
 
317
                .getMaxContemporaneousSegmentsOnTrack(track->getId());
 
318
            if (multiple == 0) multiple = 1;
 
319
 
 
320
            // nasty dupe from makeButton
 
321
 
 
322
            int buttonGap = 8;
 
323
            int vuWidth = 20;
 
324
            int vuSpacing = 2;
 
325
 
 
326
            int labelWidth = m_trackLabelWidth -
 
327
                ((m_cellSize - buttonGap) * 2 +
 
328
                 vuSpacing * 2 + vuWidth);
 
329
 
 
330
            m_trackHBoxes[i]->setMinimumSize
 
331
                (labelWidth, m_cellSize * multiple - m_borderGap);
 
332
 
 
333
            m_trackHBoxes[i]->setFixedHeight
 
334
                (m_cellSize * multiple - m_borderGap);
 
335
        }
 
336
    }
 
337
 
306
338
    // Renumber all the labels
307
339
    //
308
340
    for (unsigned int i = 0; i < m_trackLabels.size(); ++i) {
974
1006
 
975
1007
    int vuWidth = 20;
976
1008
    int vuSpacing = 2;
 
1009
    int multiple = m_doc->getComposition()
 
1010
        .getMaxContemporaneousSegmentsOnTrack(trackId);
 
1011
    if (multiple == 0) multiple = 1;
977
1012
    int labelWidth = m_trackLabelWidth - ( (m_cellSize - buttonGap) * 2 +
978
1013
                                            vuSpacing * 2 + vuWidth );
979
1014
 
988
1023
    trackHBox = new QFrame(this);
989
1024
    QHBoxLayout *hblayout = new QHBoxLayout(trackHBox);
990
1025
        
991
 
    trackHBox->setMinimumSize(labelWidth, m_cellSize - m_borderGap);
992
 
    trackHBox->setFixedHeight(m_cellSize - m_borderGap);
 
1026
    trackHBox->setMinimumSize(labelWidth, m_cellSize * multiple - m_borderGap);
 
1027
    trackHBox->setFixedHeight(m_cellSize * multiple - m_borderGap);
993
1028
 
994
1029
    // Try a style for the box
995
1030
    //
1050
1085
    //
1051
1086
    trackLabel = new TrackLabel(trackId, track->getPosition(), trackHBox);
1052
1087
    hblayout->addWidget(trackLabel);
 
1088
    hblayout->addSpacing(vuSpacing);
1053
1089
 
1054
1090
    if (track->getLabel() == std::string("")) {
1055
1091
    Rosegarden::Instrument *ins =