~ubuntu-branches/ubuntu/hardy/lmms/hardy

« back to all changes in this revision

Viewing changes to src/tracks/bb_track.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ragwitz
  • Date: 2005-12-22 16:22:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051222162250-key3p7x0212jy6dn
Tags: 0.1.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * bb_track.cpp - implementation of class bbTrack
3
3
 *
4
 
 * Linux MultiMedia Studio
5
 
 * Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
 
4
 * Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
5
 * 
 
6
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
6
7
 *
7
8
 * This program is free software; you can redistribute it and/or
8
9
 * modify it under the terms of the GNU General Public
44
45
#include "bb_track.h"
45
46
#include "song_editor.h"
46
47
#include "bb_editor.h"
47
 
#include "templates.h"
 
48
#include "gui_templates.h"
48
49
#include "name_label.h"
49
50
#include "embed.h"
50
51
#include "rename_dialog.h"
51
52
 
52
 
#include "bb_track.moc"
53
53
 
54
54
 
55
55
QMap<bbTrack *, bbTrack::bbInfoStruct> bbTrack::s_bbNums;
86
86
 
87
87
void bbTCO::movePosition( const midiTime & _pos )
88
88
{
89
 
        // bb-playlist-entries are always aligned on tact-boundaries
 
89
        // bb-playlist-entries are always aligned at tact-boundaries
90
90
        trackContentObject::movePosition( midiTime( _pos.getTact(), 0 ) );
91
91
}
92
92
 
95
95
 
96
96
void bbTCO::changeLength( const midiTime & _length )
97
97
{
98
 
        // the length of bb-playlist-entries is always a multiple of one tact
 
98
        // the length of a bb-playlist-entry is always a multiple of one tact
99
99
        trackContentObject::changeLength( midiTime( _length.getTact(), 0 ) );
100
100
}
101
101
 
164
164
        QPainter p( &pm );
165
165
 
166
166
        // COOL gradient ;-)
167
 
        for( int y = 0; y < height(); ++y )
 
167
        for( int y = 1; y < height() - 1; ++y )
168
168
        {
169
169
                p.setPen( col.light( 130 - y * 60 / height() ) );
170
 
                p.drawLine( 0, y, width(), y );
 
170
                p.drawLine( 1, y, width() - 1, y );
171
171
        }
172
172
        //pm.fill( col );
173
173
#endif
298
298
        : track( _tc )
299
299
{
300
300
        getTrackWidget()->setFixedHeight( 32 );
 
301
        // drag'n'drop with bb-tracks only causes troubles (and makes no sense
 
302
        // too), so disable it
 
303
        getTrackWidget()->setAcceptDrops( FALSE );
301
304
 
302
305
        csize bbNum = s_bbNums.size();
303
306
        bbInfoStruct bis = { bbNum, "" };
342
345
 
343
346
 
344
347
 
345
 
track::trackTypes bbTrack::trackType( void ) const
 
348
track::trackTypes bbTrack::type( void ) const
346
349
{
347
350
        return( BB_TRACK );
348
351
}
507
510
        bbEditor::inst()->setCurrentBB( s_bbNums[this].num );
508
511
        bbEditor::inst()->show();
509
512
}
 
513
 
 
514
 
 
515
 
 
516
 
 
517
#include "bb_track.moc"
 
518