~l0rdt/mixxx/features_replaygain

« back to all changes in this revision

Viewing changes to mixxx/src/engine/enginemaster.h

  • Committer: Vittorio
  • Date: 2010-10-20 15:51:58 UTC
  • mfrom: (2456.1.4 mixxx-taglib)
  • Revision ID: l0rdt@gmx.it-20101020155158-je38ncfllu04ytbf
Merged with features_taglib branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#ifndef ENGINEMASTER_H
19
19
#define ENGINEMASTER_H
20
20
 
21
 
#include "engineobject.h"
 
21
#include "engine/engineobject.h"
 
22
#include "engine/enginechannel.h"
22
23
 
23
24
class EngineWorkerScheduler;
24
25
class EngineBuffer;
36
37
class EngineVinylSoundEmu;
37
38
class EngineSideChain;
38
39
 
39
 
// class EngineBufferMasterRate;
40
 
 
41
 
/**
42
 
  *@author Tue and Ken Haste Andersen
43
 
  */
44
 
 
45
 
class EngineMaster : public EngineObject
46
 
{
 
40
class EngineMaster : public EngineObject {
47
41
public:
48
 
    EngineMaster(ConfigObject<ConfigValue> *_config,
49
 
                 EngineBuffer *buffer1, EngineBuffer *buffer2,
50
 
                 EngineChannel *, EngineChannel *, const char *group);
51
 
    ~EngineMaster();
52
 
    /** Reconfigures the EngineBufferScaleSRC objects with the sound quality written in the config database */
 
42
    EngineMaster(ConfigObject<ConfigValue>* pConfig, const char* pGroup);
 
43
    virtual ~EngineMaster();
 
44
 
 
45
    // Reconfigures the EngineBufferScaleSRC objects with the sound quality
 
46
    // written in the config database
53
47
    void setPitchIndpTimeStretch(bool b);
 
48
 
 
49
    // Get access to the sample buffers. None of these are thread safe. Only to
 
50
    // be called by SoundManager.
54
51
    const CSAMPLE* getMasterBuffer();
55
52
    const CSAMPLE* getHeadphoneBuffer();
 
53
    int numChannels();
 
54
    const CSAMPLE* getChannelBuffer(int i);
 
55
 
56
56
    void process(const CSAMPLE *, const CSAMPLE *pOut, const int iBufferSize);
57
 
private:
58
 
        void xfadeGains(FLOAT_TYPE *gain1, FLOAT_TYPE *gain2, double xfadePosition, double transform, double calibration);
 
57
 
 
58
    // Add an EngineChannel to the mixing engine. This is not thread safe --
 
59
    // only call it before the engine has started mixing.
 
60
    void addChannel(EngineChannel* pChannel);
 
61
 
 
62
    static double gainForOrientation(EngineChannel::ChannelOrientation orientation,
 
63
                              double leftGain,
 
64
                              double centerGain,
 
65
                              double rightGain);
 
66
 
 
67
  private:
 
68
    QList<EngineChannel*> m_channels;
 
69
 
 
70
    CSAMPLE *m_pMaster, *m_pHead;
 
71
    QList<CSAMPLE*> m_channelBuffers;
59
72
 
60
73
    EngineWorkerScheduler *m_pWorkerScheduler;
61
74
 
62
 
    EngineBuffer *buffer1, *buffer2;
63
 
    EngineChannel *channel1, *channel2;
64
75
    EngineVolume *volume, *head_volume;
65
76
    EngineClipping *clipping, *head_clipping;
66
 
    EngineFlanger *flanger;
67
77
#ifdef __LADSPA__
68
78
    EngineLADSPA *ladspa;
69
79
#endif
70
80
    EngineVuMeter *vumeter;
71
 
    EngineVolume *volume1, *volume2;
72
 
    EngineVuMeter *vumeter1, *vumeter2;
73
 
    EngineVinylSoundEmu *vinylsound1, *vinylsound2;
74
81
    EngineSideChain *sidechain;
75
82
 
76
 
//     EngineBufferMasterRate *m_pEngineBufferMasterRate;
77
 
 
78
 
//     ControlObject *m_pControlObjectHeadphoneMute;
79
 
    ControlPotmeter *crossfader, *head_mix, *m_pBalance, *xFaderCurve, *xFaderCalibration;
80
 
    ControlPushButton *pfl1, *pfl2, *flanger1, *flanger2, *transform1, *transform2;
81
 
    CSAMPLE *m_pMaster, *m_pHead, *m_pTemp1, *m_pTemp2;
82
 
    bool master1, master2;
 
83
    ControlPotmeter *crossfader, *head_mix,
 
84
        *m_pBalance, *xFaderCurve, *xFaderCalibration;
83
85
};
84
86
 
85
87
#endif