Skip to content

Commit

Permalink
save/load project with left resized sampletrack works
Browse files Browse the repository at this point in the history
  • Loading branch information
BaraMGB committed Apr 7, 2017
1 parent f8ae969 commit f342d3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#include "SongEditor.h"
#include "StringPairDrag.h"
#include "TextFloat.h"
#include <QDebug>


/*! The width of the resize grip in pixels
*/
Expand Down Expand Up @@ -1029,7 +1029,7 @@ void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * me )
setSelected( !isSelected() );
}

if( m_action == Move || m_action == Resize )
if( m_action == Move || m_action == Resize || m_action == ResizeLeft )
{
m_tco->setJournalling( true );
}
Expand Down
7 changes: 4 additions & 3 deletions src/tracks/SampleTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "Mixer.h"
#include "EffectRackView.h"
#include "TrackLabelButton.h"
#include <QDebug>

SampleTCO::SampleTCO( Track * _track ) :
TrackContentObject( _track ),
m_sampleBuffer( new SampleBuffer ),
Expand Down Expand Up @@ -148,6 +148,7 @@ void SampleTCO::setSampleBuffer( SampleBuffer* sb )
void SampleTCO::setSampleFile( const QString & _sf )
{
m_sampleBuffer->setAudioFile( _sf );
setStartTimeOffset( 0 );
updateLength();

emit sampleChanged();
Expand Down Expand Up @@ -253,6 +254,7 @@ void SampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this )
_this.setAttribute( "len", length() );
_this.setAttribute( "muted", isMuted() );
_this.setAttribute( "src", sampleFile() );
_this.setAttribute( "off", startTimeOffset() );
if( sampleFile() == "" )
{
QString s;
Expand All @@ -277,6 +279,7 @@ void SampleTCO::loadSettings( const QDomElement & _this )
}
changeLength( _this.attribute( "len" ).toInt() );
setMuted( _this.attribute( "muted" ).toInt() );
setStartTimeOffset( _this.attribute( "off" ).toInt() );
}


Expand Down Expand Up @@ -325,7 +328,6 @@ SampleTCOView::~SampleTCOView()

void SampleTCOView::updateSample()
{
m_tco->setStartTimeOffset( 0 );
update();
// set tooltip to filename so that user can see what sample this
// sample-tco contains
Expand Down Expand Up @@ -625,7 +627,6 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames,
TrackContentObject * tco = getTCO( i );
SampleTCO * sTco = dynamic_cast<SampleTCO*>( tco );
float framesPerTick = Engine::framesPerTick();

if( _start >= sTco->startPosition() && _start < sTco->endPosition() )
{
if( sTco->isPlaying() == false && _start > sTco->startPosition() + sTco->startTimeOffset() )
Expand Down

0 comments on commit f342d3c

Please sign in to comment.