Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable sample track recording #3947

Closed
wants to merge 160 commits into from
Closed
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
1971879
SampleTrack: Uncomment disabled recording-related code.
Reflexe Nov 6, 2017
5a08e9e
SampleTrack: Fix TCO not being played on the first tick (if it starts on
Reflexe Nov 6, 2017
44fa0c5
AudioJack: Basic implementation of capture (without AUDIO_PORT_SUPPORT)
Reflexe Nov 6, 2017
59964e7
Mixer & PlayHandle: Support PlayHandle without audioPort and set
Reflexe Nov 6, 2017
ce020f6
Some changes to jack capture.
Reflexe Nov 6, 2017
29d7237
(minor & style): Spaces to tabs.
Reflexe Nov 6, 2017
dcc4424
AudioSdl: Add support for full SDL2 with float samples and recording
Reflexe Nov 7, 2017
9df983f
Mixer -> pushInputFrames: Add an option to automaticly normalize input
Reflexe Nov 7, 2017
5735f6f
AudioPulseAudio: Switch playback sample type to float and add capture
Reflexe Nov 8, 2017
cdc7474
Track -> SampleTrack: Do not save start time offset for empty
Reflexe Nov 8, 2017
1c27958
AudioJack: Allocate and deallocate m_tempInBufs.
Reflexe Nov 8, 2017
0aa2631
SampleTrack: Make sure an empty TCO with isRecord would still be
Reflexe Nov 8, 2017
b37c451
SampleTrack: Reset the start time offset when importing a new
Reflexe Nov 8, 2017
ad6cd48
SampleRecordHandle: Apply start offset to reocrded TCO.
Reflexe Nov 9, 2017
2706271
Track, TrackView: Instead of trying every possible `dynamic_cast` in
Reflexe Nov 11, 2017
5790a38
SampleTrack Recording: Add per SampleTrack and a global fallback for the
Reflexe Nov 11, 2017
834d36b
Editor -> Style: Reorder editor buttons.
Reflexe Nov 11, 2017
c436f9d
SampleTrack -> RecordingChannel: Remove the default option, instead, all
Reflexe Nov 12, 2017
17849f5
SampleTrack: Change recordingChannel menu label.
Reflexe Nov 12, 2017
e3c4b6a
SampleTrack: In a case of recording, play a sample TCO even if its
Reflexe Nov 17, 2017
e1d43f5
SampleRecordHandle: Obtain the offset to the record with a parameter
Reflexe Nov 17, 2017
b4a7202
AudioJack: Fix a deadblock on exporting a sample with different sample
Reflexe Dec 2, 2017
dcf98d3
SongEditor: Hide the global channel selection toolbox when capture
Reflexe Dec 2, 2017
fedbd31
AudioSdl: Set isCapture to 0 for the output device.
Reflexe Dec 3, 2017
bba871d
SongEditor: (re-)Fix hiding the channel selection tool when recording is
Reflexe Dec 3, 2017
8a60410
Style: Replace spaces with tabs.
Reflexe Dec 9, 2017
1b4a663
SongEditor: Hide the record button.
Reflexe Dec 9, 2017
f1843c1
Style: Remove unnecessary tabs.
Reflexe Dec 9, 2017
be77b33
AudioSdl: Use NULL for device names in order to get the default device.
Reflexe Dec 10, 2017
334abdc
Bugfix - SampleTrack -> Load & Save: Fix recorded sample track not being
Reflexe Dec 16, 2017
205ec07
Bugfix - SampleTrack -> Play: Fix sample track not being played in the
Reflexe Dec 16, 2017
4b4e8cd
SampleTrack -> Recording: Enable per-track record setting and
Reflexe Dec 16, 2017
228927e
SampleTrack: On project save, save the values of SampleTrack::m_record
Reflexe Dec 17, 2017
0deafa3
SampleTrack -> Minor: Reorder the constructor initialization order to
Reflexe Dec 17, 2017
d46f363
Merge branch 'master' of https://github.com/LMMS/lmms
Reflexe Dec 18, 2017
f252746
Merge branch 'master' into master
Reflexe Dec 20, 2017
f23723e
AudioSDL -> SDL2: Fix a crash from calling a SDL1 function instead of
Reflexe Dec 21, 2017
ea3c766
Merge branch 'master' of github.com:Reflexe/lmms
Reflexe Dec 21, 2017
b860d9f
AudioJack -> Style: Remove tailing whitespaces.
Reflexe Dec 21, 2017
e84b99a
Merge branch 'master' of https://github.com/LMMS/lmms
Reflexe Dec 23, 2017
8766066
Travis: Use SDL2 on Windows.
Reflexe Dec 23, 2017
051f88e
Travis: Attempt to install std2 on MinGW by installing raw binary
Reflexe Dec 23, 2017
d422a6b
Travis -> Improvments for the sdl2 install
Reflexe Dec 23, 2017
3e9f8e8
Travis > Try to install SDL2 with cross option.
Reflexe Dec 23, 2017
d368e74
Travis > SDL2: Add sudo
Reflexe Dec 23, 2017
5f97762
Travis -> SDL2: Remove the directory AFTER you get out of there.
Reflexe Dec 23, 2017
d98f77b
Travis -> SDL2: Another try...
Reflexe Dec 23, 2017
d25ffe0
Travis -> SDL2: :(
Reflexe Dec 23, 2017
67785c4
Travis -> SDL2: Will it work?
Reflexe Dec 24, 2017
5191183
Travis -> SDL2: Maybe now?
Reflexe Dec 24, 2017
fc00754
Travis -> SDL2: Maybe? :(
Reflexe Dec 24, 2017
ad7d16b
And now?
Reflexe Dec 24, 2017
304478c
Bash != Fun
Reflexe Dec 24, 2017
e134375
AudioSdl: (hopefully) solve a problem with a qMin error.
Reflexe Dec 24, 2017
5f8a023
Travis -> SDL2: Add "" around OPTS
Reflexe Dec 24, 2017
e4360ef
Revert "Travis -> SDL2: Add "" around OPTS"
Reflexe Dec 24, 2017
bbc8555
Travis -> InstallRaw: Fix Shellcheck warnings.
Reflexe Dec 25, 2017
8497c47
Travis -> Linux: Use SDL2 by default.
Reflexe Dec 25, 2017
f20c0bd
CMake -> Install: Install SDL2.dll instead of SDL.dll.
Reflexe Dec 25, 2017
c2ba2f6
AudioJack: Connect capture stream to LMMS by default.
Reflexe Feb 24, 2018
3743ebd
AudioJack: Stupid me forgot one |.
Reflexe Feb 24, 2018
f6b8d60
AudioSdl -> Recording - Bugfix: Due to spec.sampleRate being wrong,
Reflexe Feb 24, 2018
59b033e
Travis -> SDL2: Install the SDL2 package for windows and remove the old
Reflexe Feb 24, 2018
e1c884c
Merge branch 'master' of https://github.com/LMMS/lmms
Reflexe Feb 24, 2018
46dbc8c
Travos -> SDL2: add toby's PPA.
Reflexe Feb 24, 2018
b4e02db
Travis: Maybe now?
Reflexe Feb 24, 2018
10b17cf
.
Reflexe Feb 24, 2018
87c18e8
.
Reflexe Feb 24, 2018
1d46f5d
.
Reflexe Feb 24, 2018
c03e5c9
.
Reflexe Feb 24, 2018
6ca126d
.
Reflexe Feb 24, 2018
70e6e85
.
Reflexe Feb 24, 2018
80ef8e5
.
Reflexe Feb 24, 2018
02c7106
.
Reflexe Feb 24, 2018
19fac16
Revent my trying to use Toby's PPA: it does not support trusty.
Reflexe Feb 24, 2018
88df2ca
Style -> SampleTrack Recording: Paint recorded sampletrack red (intead
Reflexe Mar 31, 2018
7cba7a9
Style: spaces to tabs.
Reflexe Apr 2, 2018
d627e90
basics: Change sampleFrame to `std::array<sample_t, DEFAULT_CHANNELS>`
Reflexe Apr 9, 2018
67074d2
SampleBuffer: Internally change buffer to std::vector and support
Reflexe Apr 9, 2018
7b987a6
SampleRecordHandle and SampleTrack: Support in-recording updating and
Reflexe Apr 9, 2018
4248caa
CMakeLists.txt: Require libsamplerate to be at least 0.1.9 in order to
Reflexe Apr 29, 2018
c019b06
Merge origin/master to use circleCI
Reflexe Apr 29, 2018
797aa27
Fixup a few merge errors.
Reflexe Apr 29, 2018
960b50b
Fixup merge
Reflexe Apr 29, 2018
d5cc4b1
Merge remote-tracking branch 'origin/master'
Reflexe Apr 30, 2018
640f577
Fixup previous merge
Reflexe Apr 30, 2018
c02f021
Merge branch 'master' of github.com:Reflexe/lmms
Reflexe Apr 30, 2018
08c0cdb
SampleBuffer and libsamplerate: revent back to libsamplerate `0.1.8` in
Reflexe Apr 30, 2018
5fc4eff
Revent changes in norminizing SampleBuffer path.
Reflexe May 1, 2018
d19be2e
SamplePlayHandle: Fix double-free, when the handle thinks it has an
Reflexe May 7, 2018
6bb07d4
Recording and SampleTrack: Remove setSampleBuffer and introduce
Reflexe May 7, 2018
6e2fa43
CircleCI: Upload Win{32,64} artifacts.
Reflexe May 7, 2018
a25d0b4
Try to support CircleCI windows artifacts.
Reflexe May 7, 2018
3424e39
I hope it will work now.
Reflexe May 7, 2018
e8fd490
Plz work now
Reflexe May 7, 2018
95b8997
Now?
Reflexe May 7, 2018
e86bf65
Revert "Now?"
Reflexe May 7, 2018
37a74df
Revert "Plz work now"
Reflexe May 7, 2018
18e1cc5
Revert "I hope it will work now."
Reflexe May 7, 2018
4141566
Revert "Try to support CircleCI windows artifacts."
Reflexe May 7, 2018
4eaa014
Revert "CircleCI: Upload Win{32,64} artifacts."
Reflexe May 7, 2018
2823a7f
MemoryManager: Add == and != operators for MmAllocator.
Reflexe May 7, 2018
0e379d9
Recording: Don't apply masterGain for input frames.
Reflexe May 8, 2018
e79c3af
SampleTCO -> recording: Export is_record attribute for future loading.
Reflexe May 8, 2018
634ba3b
SampleBuffer: fix resampleing error: null output data.
Reflexe May 9, 2018
2adea81
SamplePlayHandle: Automaticlly create the handle's audio port instead of
Reflexe May 17, 2018
d732738
Cleanup for next commit: Remove the unused AudioSampleRecorder.
Reflexe May 17, 2018
fd59a0e
SampleBuffer: Remove the god function "update" and split it into a
Reflexe May 18, 2018
cf3c16e
Mixer: Fix another crash with play handle without an audioPort.
Reflexe May 18, 2018
1e8afe6
SampleRecordHandle: Tell mixer to remove us when we done. With
Reflexe May 18, 2018
7ad8c62
SampleBuffer: Fix a few issues caused by
Reflexe May 19, 2018
4f7f0dd
AudioPortAudio: Support recording.
Reflexe May 19, 2018
77b3cd1
AudioFileProcessor: Fix reversing regression that was caused by a
Reflexe May 19, 2018
de092ec
SampleTrack -> Minor: What is channnnel?
Reflexe May 19, 2018
cb6b461
SampleTrack: Move per-track slots from SampleTCO to SampleTrack.
Reflexe May 19, 2018
b26dc38
Song -> Recording with loop: support creating of recording tcos in
Reflexe May 19, 2018
b968baf
SampleRecordHandle: Fix a bug when even when not recording, a track set
Reflexe May 19, 2018
2ff6db7
SampleBuffer -> Files: Pass the right path to changeAudioFile.
Reflexe May 19, 2018
3a3be2c
SampleBuffer: Don't always unlock the mixer in resetData.
Reflexe May 20, 2018
c75a167
SampleBuffer -> Samplerate - Fix two sample rate issues:
Reflexe May 22, 2018
03dc34e
SamplePlayHandle: amend previous commit: sampleRate instead of
Reflexe May 22, 2018
68da7d8
LmmsBasics: Use a custom storage class for a frame (instead of
Reflexe May 23, 2018
79b4041
AudioJack -> Recording -> Performence: Use `std::vector::resize` instead
Reflexe May 23, 2018
a170cb9
AudioFileProcessorView: Initialize m_reversed.
Reflexe May 23, 2018
84a1f35
SampleBuffer: A few changes
Reflexe May 23, 2018
1e1f038
SampleBuffer: Don't normalize any SampleBuffer's sample rate to the
Reflexe May 23, 2018
77900c9
Windows -> Recording: Enable jack.
Reflexe May 24, 2018
feff6a2
CMake Build -> Weak Jack: Don't try to find jack libraries if we use
Reflexe May 26, 2018
0f3fc07
LmmsBasics: Revert 68da7d8d46da860f3ec2e9ca169c46ca07a218f4 and add
Reflexe May 26, 2018
56fd51c
Travis: Install jack on win32 builds for its headers.
Reflexe May 26, 2018
825df24
Travis -> Jack: jack -> libjack-dev on win32.
Reflexe May 26, 2018
854b8eb
Revert "CMake Build -> Weak Jack: Don't try to find jack libraries if we
Reflexe May 26, 2018
c40d9fd
EffectSelectDialog: Fix error with clang.
Reflexe May 26, 2018
032a558
Song: Fix loops and recording.
Reflexe May 26, 2018
756d8db
Revert "EffectSelectDialog: Fix error with clang."
Reflexe May 26, 2018
c70c842
Win32 Installer -> Jack: Try to bundle jack installer.
Reflexe May 26, 2018
b5288ed
Minor -> CMake: Style changes.
Reflexe May 26, 2018
baeb0ec
Minor change in previous commit
Reflexe May 26, 2018
bc1c8c7
Support Jack on Windows + Bundled jack Installer (#6)
Reflexe May 26, 2018
4992f3b
Merge branch 'master' of https://github.com/LMMS/lmms
Reflexe May 28, 2018
2febe3c
Merge branch 'master' of github.com:Reflexe/lmms
Reflexe May 28, 2018
33ecc9d
SampleBuffer: Use `resetData` instead of `beginBufferChange` when
Reflexe Jun 1, 2018
686263e
SampleBuffer: Make `frames()` thread-safe.
Reflexe Jun 1, 2018
ce5eb19
SampleBuffer & SampleTCOView: Cache visualization while recording.
Reflexe Jun 2, 2018
cd3699d
PulseAudio: Disable recording since it produces voices from hell.
Reflexe Jun 2, 2018
c68f847
AudioSdl: Disable recording in linux since it have a very high latency
Reflexe Jun 2, 2018
30494c9
AudioFileProcessor: Apply changes that has been made to SampleBuffer.
Reflexe Jun 2, 2018
1e75cbe
Merge branch 'master' of https://github.com/LMMS/lmms
Reflexe Jun 2, 2018
a2eb78a
SampleTrack: Avoid crashes while recording by locking the mixer before
Reflexe Jun 2, 2018
ceabe0c
SampleTrackView: Fix visualization not being cleared between recording
Reflexe Jun 2, 2018
c041d43
SamplePlayHandle: Fix export issues by correctly calculating
Reflexe Jun 2, 2018
52661d7
SampleTCOView: Implement caching for visualization.
Reflexe Jun 9, 2018
5ee299a
SampleTCO -> Recording: Block resize and move actions while recording.
Reflexe Jun 9, 2018
af1820f
SampleTrack: Remove invalid assert.
Reflexe Jun 9, 2018
0fb6317
Song -> Recording: Handle loop points correctly.
Reflexe Jun 9, 2018
ee548c5
SampleBufferVisualizer: Avoid using Q_FALLTHROUGH when it is undefined.
Reflexe Jun 9, 2018
6b69b79
SampleBuffer: Fix a error with not-stereo files not being loaded.
Reflexe Jun 10, 2018
d2f739d
SampleBuffer -> SoundFile: Support mono files, show a warning for
Reflexe Jun 10, 2018
314ab17
Song -> Loops -> Recording: Make sure we're recording before emit-ing
Reflexe Jun 10, 2018
a415433
SampleBuffer -> Recording: Use less blocking locks with addData and
Reflexe Jun 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/AudioJack.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include <QtCore/QMap>
#include <QMutexLocker>

#include <memory>

#include "AudioDevice.h"
#include "AudioDeviceSetupWidget.h"

Expand Down Expand Up @@ -112,7 +114,10 @@ private slots:

MidiJack *m_midiClient;
QVector<jack_port_t *> m_outputPorts;
QVector<jack_port_t *> m_inputPorts;
jack_default_audio_sample_t * * m_tempOutBufs;
jack_default_audio_sample_t * * m_tempInBufs;
std::unique_ptr<sampleFrame[]> m_inBuffer;
surroundSampleFrame * m_outBuf;

f_cnt_t m_framesDoneInCurBuf;
Expand Down
6 changes: 4 additions & 2 deletions include/AudioPulseAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ class AudioPulseAudio : public AudioDevice, public QThread


void streamWriteCallback( pa_stream * s, size_t length );
void streamReadCallback(pa_stream *s, size_t length);

void signalConnected( bool connected );

pa_stream * m_s;
pa_sample_spec m_sampleSpec;

pa_stream * m_recordStream;
pa_sample_spec m_recordSampleSpec;


private:
virtual void startProcessing();
Expand All @@ -86,8 +90,6 @@ class AudioPulseAudio : public AudioDevice, public QThread

volatile bool m_quit;

bool m_convertEndian;

bool m_connected;
QSemaphore m_connectedSemaphore;

Expand Down
20 changes: 19 additions & 1 deletion include/AudioSdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,35 @@ class AudioSdl : public AudioDevice
static void sdlAudioCallback( void * _udata, Uint8 * _buf, int _len );
void sdlAudioCallback( Uint8 * _buf, int _len );

#ifdef LMMS_HAVE_SDL2
static void sdlInputAudioCallback( void * _udata, Uint8 * _buf, int _len );
void sdlInputAudioCallback( Uint8 * _buf, int _len );
#endif

SDL_AudioSpec m_audioHandle;

surroundSampleFrame * m_outBuf;

#ifdef LMMS_HAVE_SDL2
uint64_t m_currentBufferFramePos;
uint64_t m_currentBufferFramesCount;
#else
Uint8 * m_convertedBuf;
int m_convertedBufPos;
int m_convertedBufSize;
bool m_outConvertEndian;
#endif

bool m_convertEndian;

bool m_stopped;

#ifdef LMMS_HAVE_SDL2
SDL_AudioDeviceID m_outputDevice;

SDL_AudioSpec m_inputAudioHandle;
SDL_AudioDeviceID m_inputDevice;
#endif

} ;

#endif
Expand Down
6 changes: 6 additions & 0 deletions include/AutomationTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ class AutomationTrack : public Track

class AutomationTrackView : public TrackView
{
Q_OBJECT
public:
AutomationTrackView( AutomationTrack* at, TrackContainerView* tcv );
virtual ~AutomationTrackView();

virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );

virtual void updateTrackOperationsWidgetMenu (TrackOperationsWidget *trackOperations) override;

public slots:
void recordingOn();
void recordingOff();
} ;


Expand Down
4 changes: 4 additions & 0 deletions include/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@


#include "export.h"
#include "lmms_basics.h"

class BBTrackContainer;
class DummyTrackContainer;
Expand Down Expand Up @@ -100,6 +101,9 @@ class EXPORT LmmsCore : public QObject
{
return s_framesPerTick;
}

static float framesPerTick (sample_rate_t sample_rate);

static void updateFramesPerTick();

static inline LmmsCore * inst()
Expand Down
2 changes: 2 additions & 0 deletions include/InstrumentTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ class InstrumentTrackView : public TrackView
QMenu * createFxMenu( QString title, QString newFxLabel );


virtual void updateTrackOperationsWidgetMenu (TrackOperationsWidget *trackOperations) override;

protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
Expand Down
5 changes: 4 additions & 1 deletion include/Mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class EXPORT Mixer : public QObject
return m_fifoWriter != NULL;
}

void pushInputFrames( sampleFrame * _ab, const f_cnt_t _frames );
void pushInputFrames(const sampleFrame *_ab, const f_cnt_t _frames , bool shouldApplyMasterGain=false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should put a space after and before =.


inline const sampleFrame * inputBuffer()
{
Expand All @@ -304,6 +304,9 @@ class EXPORT Mixer : public QObject
inline bool isMetronomeActive() const { return m_metronomeActive; }
inline void setMetronomeActive(bool value = true) { m_metronomeActive = value; }

void applyMasterGainToInputBuffer (sampleFrame *frames_data,
const size_t frames_count, uint channels_count, float gain);

void requestChangeInModel();
void doneChangeInModel();

Expand Down
22 changes: 21 additions & 1 deletion include/SampleRecordHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include "MidiTime.h"
#include "PlayHandle.h"
#include "SampleTrack.h"


class BBTrack;
class SampleBuffer;
Expand All @@ -41,7 +43,7 @@ class Track;
class SampleRecordHandle : public PlayHandle
{
public:
SampleRecordHandle( SampleTCO* tco );
SampleRecordHandle( SampleTCO* tco , MidiTime startRecordTimeOffset);
virtual ~SampleRecordHandle();

virtual void play( sampleFrame * _working_buffer );
Expand All @@ -54,6 +56,17 @@ class SampleRecordHandle : public PlayHandle


private:
void copyBufferFromMonoLeft( const sampleFrame * inputBuffer,
sampleFrame *outputBuffer,
const f_cnt_t _frames);
void copyBufferFromMonoRight( const sampleFrame * inputBuffer,
sampleFrame *outputBuffer,
const f_cnt_t _frames);
void copyBufferFromStereo( const sampleFrame * inputBuffer,
sampleFrame *outputBuffer,
const f_cnt_t _frames);


virtual void writeBuffer( const sampleFrame * _ab,
const f_cnt_t _frames );

Expand All @@ -66,6 +79,13 @@ class SampleRecordHandle : public PlayHandle
BBTrack * m_bbTrack;
SampleTCO * m_tco;

// The recording type as it was when we started
// recording.
SampleTrack::RecordingChannel m_recordingChannel;

// The offset from the start of m_track that the record has
// started from.
MidiTime m_startRecordTimeOffset;
} ;


Expand Down
27 changes: 27 additions & 0 deletions include/SampleTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ class SampleTCO : public TrackContentObject
bool isPlaying() const;
void setIsPlaying(bool isPlaying);

/**
* @brief isEmpty Check if this TCO has not content.
*/
bool isEmpty() const;

public slots:
void setSampleBuffer( SampleBuffer* sb );
void setSampleFile( const QString & _sf );
Expand Down Expand Up @@ -127,7 +132,15 @@ public slots:
class SampleTrack : public Track
{
Q_OBJECT
mapPropertyFromModel(bool,isRecord,setRecord,m_recordModel);
public:
enum RecordingChannel : int {
None,
MonoRight,
MonoLeft,
Stereo,
};

SampleTrack( TrackContainer* tc );
virtual ~SampleTrack();

Expand All @@ -151,11 +164,19 @@ class SampleTrack : public Track
return "sampletrack";
}

RecordingChannel recordingChannel() const;
void setRecordingChannel(const RecordingChannel &recordingChannel);

public slots:
void updateTcos();
void setPlayingTcos( bool isPlaying );
void beforeRecord ();
void toggleRecord();

private:
IntModel m_recordingChannelModel;

BoolModel m_recordModel;
FloatModel m_volumeModel;
FloatModel m_panningModel;
AudioPort m_audioPort;
Expand All @@ -176,6 +197,8 @@ class SampleTrackView : public TrackView
virtual ~SampleTrackView();


virtual void updateTrackOperationsWidgetMenu (TrackOperationsWidget *trackOperations) override;

public slots:
void showEffects();

Expand All @@ -188,7 +211,11 @@ public slots:
}


private slots:
void onRecordActionSelected (QAction *action);

private:
QAction *m_toggleRecordAction;
EffectRackView * m_effectRack;
QWidget * m_effWindow;
Knob * m_volumeKnob;
Expand Down
2 changes: 2 additions & 0 deletions include/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ public slots:

void addBBTrack();

signals:
void beforeRecord ();

private slots:
void insertBar();
Expand Down
7 changes: 7 additions & 0 deletions include/SongEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "ActionGroup.h"
#include "Editor.h"
#include "TrackContainerView.h"
#include "SampleTrack.h"

class QLabel;
class QScrollBar;
Expand Down Expand Up @@ -156,6 +157,8 @@ class SongEditorWindow : public Editor

SongEditor* m_editor;

SampleTrack::RecordingChannel globalRecordChannel() const;

protected:
virtual void resizeEvent( QResizeEvent * event );

Expand All @@ -168,6 +171,8 @@ protected slots:
void lostFocus();
void adjustUiAfterProjectLoad();

void onRecordChannelSelected(QAction *action);

signals:
void playTriggered();
void resized();
Expand All @@ -186,6 +191,8 @@ protected slots:
QAction* m_crtlAction;

ComboBox * m_zoomingComboBox;

SampleTrack::RecordingChannel m_globalRecordChannel = SampleTrack::RecordingChannel::Stereo;
};

#endif
6 changes: 4 additions & 2 deletions include/Track.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ class TrackOperationsWidget : public QWidget
~TrackOperationsWidget();


QPushButton *trackOps() const;

protected:
virtual void mousePressEvent( QMouseEvent * me );
virtual void paintEvent( QPaintEvent * pe );
Expand All @@ -438,8 +440,6 @@ private slots:
void cloneTrack();
void removeTrack();
void updateMenu();
void recordingOn();
void recordingOff();
void clearTrack();

private:
Expand Down Expand Up @@ -676,6 +676,8 @@ class TrackView : public QWidget, public ModelView, public JournallingObject

virtual void update();

virtual void updateTrackOperationsWidgetMenu (TrackOperationsWidget *trackOperations);


public slots:
virtual bool close();
Expand Down
3 changes: 3 additions & 0 deletions include/lmms_basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ const ch_cnt_t SURROUND_CHANNELS =
2;
#endif

// "In audio 1 is always the left" - umcaruje, 2017
const ch_cnt_t RIGHT_CHANNEL_INDEX = 1;
const ch_cnt_t LEFT_CHANNEL_INDEX = 0;

#ifdef LMMS_BUILD_WIN32
#define LADSPA_PATH_SEPERATOR ';'
Expand Down
5 changes: 5 additions & 0 deletions src/core/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ void LmmsCore::destroy()
delete ConfigManager::inst();
}

float LmmsCore::framesPerTick(sample_rate_t sample_rate) {
return sample_rate * 60.0f * 4 /
DefaultTicksPerTact / s_song->getTempo();
}




Expand Down
Loading