-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With USB streaming devices only
- Loading branch information
Showing
6 changed files
with
40 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// kernel.cpp | ||
// | ||
// MiniSynth Pi - A virtual analogue synthesizer for Raspberry Pi | ||
// Copyright (C) 2017-2022 R. Stange <[email protected]> | ||
// Copyright (C) 2017-2024 R. Stange <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
@@ -111,6 +111,7 @@ boolean CKernel::Initialize (void) | |
|
||
if (bOK) | ||
{ | ||
#if RASPPI <= 4 | ||
const char *pSoundDevice = m_Options.GetSoundDevice (); | ||
assert (pSoundDevice); | ||
if (strcmp (pSoundDevice, "sndi2s") == 0) | ||
|
@@ -128,6 +129,9 @@ boolean CKernel::Initialize (void) | |
{ | ||
m_pSynthesizer = new CMiniSynthesizerPWM (&m_Config, &m_Interrupt); | ||
} | ||
#else | ||
m_pSynthesizer = new CMiniSynthesizerUSB (&m_Config, &m_Interrupt); | ||
#endif | ||
|
||
assert (m_pSynthesizer); | ||
bOK = m_pSynthesizer->Initialize (); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// minisynth.cpp | ||
// | ||
// MiniSynth Pi - A virtual analogue synthesizer for Raspberry Pi | ||
// Copyright (C) 2017-2023 R. Stange <[email protected]> | ||
// Copyright (C) 2017-2024 R. Stange <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
@@ -185,6 +185,8 @@ void CMiniSynthesizer::GlobalUnlock (void) | |
|
||
//// PWM ////////////////////////////////////////////////////////////////////// | ||
|
||
#if RASPPI <= 4 | ||
|
||
CMiniSynthesizerPWM::CMiniSynthesizerPWM (CSynthConfig *pConfig, | ||
CInterruptSystem *pInterrupt) | ||
: CMiniSynthesizer (pConfig, pInterrupt), | ||
|
@@ -269,8 +271,12 @@ unsigned CMiniSynthesizerPWM::GetChunk (u32 *pBuffer, unsigned nChunkSize) | |
return nResult; | ||
} | ||
|
||
#endif | ||
|
||
//// I2S ////////////////////////////////////////////////////////////////////// | ||
|
||
#if RASPPI <= 4 | ||
|
||
CMiniSynthesizerI2S::CMiniSynthesizerI2S (CSynthConfig *pConfig, | ||
CInterruptSystem *pInterrupt, | ||
CI2CMaster *pI2CMaster) | ||
|
@@ -356,6 +362,8 @@ unsigned CMiniSynthesizerI2S::GetChunk (u32 *pBuffer, unsigned nChunkSize) | |
return nResult; | ||
} | ||
|
||
#endif | ||
|
||
//// USB ////////////////////////////////////////////////////////////////////// | ||
|
||
#if RASPPI >= 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// minisynth.h | ||
// | ||
// MiniSynth Pi - A virtual analogue synthesizer for Raspberry Pi | ||
// Copyright (C) 2017-2023 R. Stange <[email protected]> | ||
// Copyright (C) 2017-2024 R. Stange <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
@@ -98,6 +98,8 @@ class CMiniSynthesizer | |
|
||
//// PWM ////////////////////////////////////////////////////////////////////// | ||
|
||
#if RASPPI <= 4 | ||
|
||
class CMiniSynthesizerPWM : public CMiniSynthesizer, public CPWMSoundBaseDevice | ||
{ | ||
public: | ||
|
@@ -115,8 +117,12 @@ class CMiniSynthesizerPWM : public CMiniSynthesizer, public CPWMSoundBaseDevice | |
boolean m_bChannelsSwapped; | ||
}; | ||
|
||
#endif | ||
|
||
//// I2S ////////////////////////////////////////////////////////////////////// | ||
|
||
#if RASPPI <= 4 | ||
|
||
class CMiniSynthesizerI2S : public CMiniSynthesizer, public CI2SSoundBaseDevice | ||
{ | ||
public: | ||
|
@@ -135,6 +141,8 @@ class CMiniSynthesizerI2S : public CMiniSynthesizer, public CI2SSoundBaseDevice | |
boolean m_bChannelsSwapped; | ||
}; | ||
|
||
#endif | ||
|
||
//// USB ////////////////////////////////////////////////////////////////////// | ||
|
||
#if RASPPI >= 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// serialmididevice.cpp | ||
// | ||
// MiniSynth Pi - A virtual analogue synthesizer for Raspberry Pi | ||
// Copyright (C) 2017-2022 R. Stange <[email protected]> | ||
// Copyright (C) 2017-2024 R. Stange <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
|
@@ -25,9 +25,9 @@ CSerialMIDIDevice::CSerialMIDIDevice (CMiniSynthesizer *pSynthesizer, CInterrupt | |
CSynthConfig *pConfig) | ||
: CMIDIDevice (pSynthesizer, pConfig), | ||
#if RASPPI <= 3 && defined (USE_USB_FIQ) | ||
m_Serial (pInterrupt, FALSE), | ||
m_Serial (pInterrupt, FALSE, 0), | ||
#else | ||
m_Serial (pInterrupt, TRUE), | ||
m_Serial (pInterrupt, TRUE, 0), | ||
#endif | ||
m_nSerialState (0) | ||
{ | ||
|