@@ -315,18 +315,17 @@ class FlacWriter : public AudioFormatWriter | |||||
{ | { | ||||
public: | public: | ||||
//============================================================================== | //============================================================================== | ||||
FlacWriter (OutputStream* const out, | |||||
const double sampleRate_, | |||||
const int numChannels_, | |||||
const int bitsPerSample_) | |||||
FlacWriter (OutputStream* const out, double sampleRate_, | |||||
int numChannels_, int bitsPerSample_, int qualityOptionIndex) | |||||
: AudioFormatWriter (out, TRANS (flacFormatName), | : AudioFormatWriter (out, TRANS (flacFormatName), | ||||
sampleRate_, | |||||
numChannels_, | |||||
bitsPerSample_) | |||||
sampleRate_, numChannels_, bitsPerSample_) | |||||
{ | { | ||||
using namespace FlacNamespace; | using namespace FlacNamespace; | ||||
encoder = FLAC__stream_encoder_new(); | encoder = FLAC__stream_encoder_new(); | ||||
if (qualityOptionIndex > 0) | |||||
FLAC__stream_encoder_set_compression_level (encoder, jmin (8, qualityOptionIndex)); | |||||
FLAC__stream_encoder_set_do_mid_side_stereo (encoder, numChannels == 2); | FLAC__stream_encoder_set_do_mid_side_stereo (encoder, numChannels == 2); | ||||
FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, numChannels == 2); | FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, numChannels == 2); | ||||
FLAC__stream_encoder_set_channels (encoder, numChannels); | FLAC__stream_encoder_set_channels (encoder, numChannels); | ||||
@@ -510,20 +509,9 @@ const Array <int> FlacAudioFormat::getPossibleBitDepths() | |||||
return Array <int> (depths); | return Array <int> (depths); | ||||
} | } | ||||
bool FlacAudioFormat::canDoStereo() | |||||
{ | |||||
return true; | |||||
} | |||||
bool FlacAudioFormat::canDoMono() | |||||
{ | |||||
return true; | |||||
} | |||||
bool FlacAudioFormat::isCompressed() | |||||
{ | |||||
return true; | |||||
} | |||||
bool FlacAudioFormat::canDoStereo() { return true; } | |||||
bool FlacAudioFormat::canDoMono() { return true; } | |||||
bool FlacAudioFormat::isCompressed() { return true; } | |||||
AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, | AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, | ||||
const bool deleteStreamIfOpeningFails) | const bool deleteStreamIfOpeningFails) | ||||
@@ -544,11 +532,11 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, | |||||
unsigned int numberOfChannels, | unsigned int numberOfChannels, | ||||
int bitsPerSample, | int bitsPerSample, | ||||
const StringPairArray& /*metadataValues*/, | const StringPairArray& /*metadataValues*/, | ||||
int /*qualityOptionIndex*/) | |||||
int qualityOptionIndex) | |||||
{ | { | ||||
if (getPossibleBitDepths().contains (bitsPerSample)) | if (getPossibleBitDepths().contains (bitsPerSample)) | ||||
{ | { | ||||
ScopedPointer<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels, bitsPerSample)); | |||||
ScopedPointer<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels, bitsPerSample, qualityOptionIndex)); | |||||
if (w->ok) | if (w->ok) | ||||
return w.release(); | return w.release(); | ||||
@@ -33,15 +33,15 @@ | |||||
//============================================================================== | //============================================================================== | ||||
/** | /** | ||||
Holds a list of simple objects, such as ints, doubles, or pointers. | |||||
Holds a resizable array of primitive or copy-by-value objects. | |||||
Examples of arrays are: Array<int>, Array<Rectangle> or Array<MyClass*> | Examples of arrays are: Array<int>, Array<Rectangle> or Array<MyClass*> | ||||
The array can be used to hold simple, non-polymorphic objects as well as primitive types - to | |||||
The Array class can be used to hold simple, non-polymorphic objects as well as primitive types - to | |||||
do so, the class must fulfil these requirements: | do so, the class must fulfil these requirements: | ||||
- it must have a copy constructor and operator= | |||||
- it must be able to be relocated in memory by a memcpy without this causing a problem - so no | |||||
objects whose functionality relies on pointers or references to themselves can be used. | |||||
- it must have a copy constructor and assignment operator | |||||
- it must be able to be relocated in memory by a memcpy without this causing any problems - so | |||||
objects whose functionality relies on external pointers or references to themselves can be used. | |||||
You can of course have an array of pointers to any kind of object, e.g. Array <MyClass*>, but if | You can of course have an array of pointers to any kind of object, e.g. Array <MyClass*>, but if | ||||
you do this, the array doesn't take any ownership of the objects - see the OwnedArray class or the | you do this, the array doesn't take any ownership of the objects - see the OwnedArray class or the | ||||
@@ -283,8 +283,6 @@ public: | |||||
menuCreationTime = lastFocused = lastScroll = Time::getMillisecondCounter(); | menuCreationTime = lastFocused = lastScroll = Time::getMillisecondCounter(); | ||||
setWantsKeyboardFocus (true); | setWantsKeyboardFocus (true); | ||||
setMouseClickGrabsKeyboardFocus (false); | setMouseClickGrabsKeyboardFocus (false); | ||||
setOpaque (true); | |||||
setAlwaysOnTop (true); | setAlwaysOnTop (true); | ||||
Desktop::getInstance().addGlobalMouseListener (this); | Desktop::getInstance().addGlobalMouseListener (this); | ||||
@@ -324,6 +322,7 @@ public: | |||||
ScopedPointer <Window> mw (new Window()); | ScopedPointer <Window> mw (new Window()); | ||||
mw->setLookAndFeel (menu.lookAndFeel); | mw->setLookAndFeel (menu.lookAndFeel); | ||||
mw->setWantsKeyboardFocus (false); | mw->setWantsKeyboardFocus (false); | ||||
mw->setOpaque (mw->getLookAndFeel().findColour (PopupMenu::backgroundColourId).isOpaque() || ! Desktop::canUseSemiTransparentWindows()); | |||||
mw->minimumWidth = minimumWidth; | mw->minimumWidth = minimumWidth; | ||||
mw->maximumNumColumns = maximumNumColumns; | mw->maximumNumColumns = maximumNumColumns; | ||||
mw->standardItemHeight = standardItemHeight; | mw->standardItemHeight = standardItemHeight; | ||||
@@ -370,6 +369,9 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
void paint (Graphics& g) | void paint (Graphics& g) | ||||
{ | { | ||||
if (isOpaque()) | |||||
g.fillAll (Colours::white); | |||||
getLookAndFeel().drawPopupMenuBackground (g, getWidth(), getHeight()); | getLookAndFeel().drawPopupMenuBackground (g, getWidth(), getHeight()); | ||||
} | } | ||||
@@ -1861,6 +1861,7 @@ private: | |||||
return 0; | return 0; | ||||
case WM_WINDOWPOSCHANGED: | case WM_WINDOWPOSCHANGED: | ||||
doMouseEvent (getCurrentMousePos()); | |||||
handleMovedOrResized(); | handleMovedOrResized(); | ||||
if (dontRepaint) | if (dontRepaint) | ||||