1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

cosmetic cleanup

This commit is contained in:
jules 2008-06-17 11:53:12 +00:00
parent 04367b199a
commit 29e2de7fd0
40 changed files with 3783 additions and 3787 deletions

View file

@ -1,282 +1,282 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#ifndef __JUCE_FILTERGRAPH_JUCEHEADER__
#define __JUCE_FILTERGRAPH_JUCEHEADER__
class FilterInGraph;
class FilterGraph;
const char* const filenameSuffix = ".filtergraph";
const char* const filenameWildcard = "*.filtergraph";
//==============================================================================
/**
Represents a connection between two pins in a FilterGraph.
*/
class FilterConnection
{
public:
//==============================================================================
FilterConnection (FilterGraph& owner);
FilterConnection (const FilterConnection& other);
~FilterConnection();
//==============================================================================
uint32 sourceFilterID;
int sourceChannel;
uint32 destFilterID;
int destChannel;
//==============================================================================
juce_UseDebuggingNewOperator
private:
FilterGraph& owner;
const FilterConnection& operator= (const FilterConnection&);
};
//==============================================================================
/**
Represents one of the filters in a FilterGraph.
*/
/*class FilterInGraph : public ReferenceCountedObject
{
public:
//==============================================================================
FilterInGraph (FilterGraph& owner, AudioPluginInstance* const plugin);
~FilterInGraph();
//==============================================================================
AudioPluginInstance* const filter;
uint32 uid;
//==============================================================================
void showUI (bool useGenericUI);
double getX() const throw() { return x; }
double getY() const throw() { return y; }
void setPosition (double x, double y) throw();
XmlElement* createXml() const;
static FilterInGraph* createForDescription (FilterGraph& owner,
const PluginDescription& desc,
String& errorMessage);
static FilterInGraph* createFromXml (FilterGraph& owner, const XmlElement& xml);
//==============================================================================
typedef ReferenceCountedObjectPtr <FilterInGraph> Ptr;
//==============================================================================
juce_UseDebuggingNewOperator
private:
friend class FilterGraphPlayer;
FilterGraph& owner;
double x, y;
friend class PluginWindow;
Component* activeUI;
Component* activeGenericUI;
int lastX, lastY;
MidiBuffer outputMidi;
AudioSampleBuffer processedAudio;
MidiBuffer processedMidi;
void prepareBuffers (int blockSize);
void renderBlock (int numSamples,
const ReferenceCountedArray <FilterInGraph>& filters,
const OwnedArray <FilterConnection>& connections);
FilterInGraph (const FilterInGraph&);
const FilterInGraph& operator= (const FilterInGraph&);
};
*/
//==============================================================================
/**
A collection of filters and some connections between them.
*/
class FilterGraph : public FileBasedDocument
{
public:
//==============================================================================
FilterGraph();
~FilterGraph();
//==============================================================================
AudioProcessorGraph& getGraph() throw() { return graph; }
int getNumFilters() const throw();
const AudioProcessorGraph::Node::Ptr getNode (const int index) const throw();
const AudioProcessorGraph::Node::Ptr getNodeForId (const uint32 uid) const throw();
void addFilter (const PluginDescription* desc, double x, double y);
void removeFilter (const uint32 filterUID);
void disconnectFilter (const uint32 filterUID);
void removeIllegalConnections();
void setNodePosition (const int nodeId, double x, double y);
void getNodePosition (const int nodeId, double& x, double& y) const;
//==============================================================================
int getNumConnections() const throw();
const AudioProcessorGraph::Connection* getConnection (const int index) const throw();
const AudioProcessorGraph::Connection* getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw();
bool canConnect (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw();
bool addConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel);
void removeConnection (const int index);
void removeConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel);
void clear();
//==============================================================================
XmlElement* createXml() const;
void restoreFromXml (const XmlElement& xml);
//==============================================================================
const String getDocumentTitle();
const String loadDocument (const File& file);
const String saveDocument (const File& file);
const File getLastDocumentOpened();
void setLastDocumentOpened (const File& file);
/** The special channel index used to refer to a filter's midi channel.
*/
static const int midiChannelNumber;
//==============================================================================
juce_UseDebuggingNewOperator
private:
//friend class FilterGraphPlayer;
//ReferenceCountedArray <FilterInGraph> filters;
//OwnedArray <FilterConnection> connections;
AudioProcessorGraph graph;
AudioProcessorPlayer player;
uint32 lastUID;
uint32 getNextUID() throw();
void createNodeFromXml (const XmlElement& xml);
FilterGraph (const FilterGraph&);
const FilterGraph& operator= (const FilterGraph&);
};
//==============================================================================
/**
*/
/*class FilterGraphPlayer : public AudioIODeviceCallback,
public MidiInputCallback,
public ChangeListener
{
public:
//==============================================================================
FilterGraphPlayer (FilterGraph& graph);
~FilterGraphPlayer();
//==============================================================================
void setAudioDeviceManager (AudioDeviceManager* dm);
AudioDeviceManager* getAudioDeviceManager() const throw() { return deviceManager; }
//==============================================================================
void audioDeviceIOCallback (const float** inputChannelData,
int totalNumInputChannels,
float** outputChannelData,
int totalNumOutputChannels,
int numSamples);
void audioDeviceAboutToStart (double sampleRate, int numSamplesPerBlock);
void audioDeviceStopped();
void handleIncomingMidiMessage (MidiInput* source, const MidiMessage& message);
void changeListenerCallback (void*);
//==============================================================================
static int compareElements (FilterInGraph* const first, FilterInGraph* const second) throw();
const float** inputChannelData;
int totalNumInputChannels;
float** outputChannelData;
int totalNumOutputChannels;
MidiBuffer incomingMidi;
MidiKeyboardState keyState;
MidiMessageCollector messageCollector;
//==============================================================================
class PlayerAwareFilter
{
public:
virtual void setPlayer (FilterGraphPlayer* newPlayer) = 0;
};
private:
FilterGraph& graph;
CriticalSection processLock;
double sampleRate;
int blockSize;
AudioDeviceManager* deviceManager;
ReferenceCountedArray <FilterInGraph> filters;
OwnedArray <FilterConnection> connections;
void update();
FilterGraphPlayer (const FilterGraphPlayer&);
const FilterGraphPlayer& operator= (const FilterGraphPlayer&);
};
*/
#endif
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#ifndef __JUCE_FILTERGRAPH_JUCEHEADER__
#define __JUCE_FILTERGRAPH_JUCEHEADER__
class FilterInGraph;
class FilterGraph;
const char* const filenameSuffix = ".filtergraph";
const char* const filenameWildcard = "*.filtergraph";
//==============================================================================
/**
Represents a connection between two pins in a FilterGraph.
*/
class FilterConnection
{
public:
//==============================================================================
FilterConnection (FilterGraph& owner);
FilterConnection (const FilterConnection& other);
~FilterConnection();
//==============================================================================
uint32 sourceFilterID;
int sourceChannel;
uint32 destFilterID;
int destChannel;
//==============================================================================
juce_UseDebuggingNewOperator
private:
FilterGraph& owner;
const FilterConnection& operator= (const FilterConnection&);
};
//==============================================================================
/**
Represents one of the filters in a FilterGraph.
*/
/*class FilterInGraph : public ReferenceCountedObject
{
public:
//==============================================================================
FilterInGraph (FilterGraph& owner, AudioPluginInstance* const plugin);
~FilterInGraph();
//==============================================================================
AudioPluginInstance* const filter;
uint32 uid;
//==============================================================================
void showUI (bool useGenericUI);
double getX() const throw() { return x; }
double getY() const throw() { return y; }
void setPosition (double x, double y) throw();
XmlElement* createXml() const;
static FilterInGraph* createForDescription (FilterGraph& owner,
const PluginDescription& desc,
String& errorMessage);
static FilterInGraph* createFromXml (FilterGraph& owner, const XmlElement& xml);
//==============================================================================
typedef ReferenceCountedObjectPtr <FilterInGraph> Ptr;
//==============================================================================
juce_UseDebuggingNewOperator
private:
friend class FilterGraphPlayer;
FilterGraph& owner;
double x, y;
friend class PluginWindow;
Component* activeUI;
Component* activeGenericUI;
int lastX, lastY;
MidiBuffer outputMidi;
AudioSampleBuffer processedAudio;
MidiBuffer processedMidi;
void prepareBuffers (int blockSize);
void renderBlock (int numSamples,
const ReferenceCountedArray <FilterInGraph>& filters,
const OwnedArray <FilterConnection>& connections);
FilterInGraph (const FilterInGraph&);
const FilterInGraph& operator= (const FilterInGraph&);
};
*/
//==============================================================================
/**
A collection of filters and some connections between them.
*/
class FilterGraph : public FileBasedDocument
{
public:
//==============================================================================
FilterGraph();
~FilterGraph();
//==============================================================================
AudioProcessorGraph& getGraph() throw() { return graph; }
int getNumFilters() const throw();
const AudioProcessorGraph::Node::Ptr getNode (const int index) const throw();
const AudioProcessorGraph::Node::Ptr getNodeForId (const uint32 uid) const throw();
void addFilter (const PluginDescription* desc, double x, double y);
void removeFilter (const uint32 filterUID);
void disconnectFilter (const uint32 filterUID);
void removeIllegalConnections();
void setNodePosition (const int nodeId, double x, double y);
void getNodePosition (const int nodeId, double& x, double& y) const;
//==============================================================================
int getNumConnections() const throw();
const AudioProcessorGraph::Connection* getConnection (const int index) const throw();
const AudioProcessorGraph::Connection* getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw();
bool canConnect (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw();
bool addConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel);
void removeConnection (const int index);
void removeConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel);
void clear();
//==============================================================================
XmlElement* createXml() const;
void restoreFromXml (const XmlElement& xml);
//==============================================================================
const String getDocumentTitle();
const String loadDocument (const File& file);
const String saveDocument (const File& file);
const File getLastDocumentOpened();
void setLastDocumentOpened (const File& file);
/** The special channel index used to refer to a filter's midi channel.
*/
static const int midiChannelNumber;
//==============================================================================
juce_UseDebuggingNewOperator
private:
//friend class FilterGraphPlayer;
//ReferenceCountedArray <FilterInGraph> filters;
//OwnedArray <FilterConnection> connections;
AudioProcessorGraph graph;
AudioProcessorPlayer player;
uint32 lastUID;
uint32 getNextUID() throw();
void createNodeFromXml (const XmlElement& xml);
FilterGraph (const FilterGraph&);
const FilterGraph& operator= (const FilterGraph&);
};
//==============================================================================
/**
*/
/*class FilterGraphPlayer : public AudioIODeviceCallback,
public MidiInputCallback,
public ChangeListener
{
public:
//==============================================================================
FilterGraphPlayer (FilterGraph& graph);
~FilterGraphPlayer();
//==============================================================================
void setAudioDeviceManager (AudioDeviceManager* dm);
AudioDeviceManager* getAudioDeviceManager() const throw() { return deviceManager; }
//==============================================================================
void audioDeviceIOCallback (const float** inputChannelData,
int totalNumInputChannels,
float** outputChannelData,
int totalNumOutputChannels,
int numSamples);
void audioDeviceAboutToStart (double sampleRate, int numSamplesPerBlock);
void audioDeviceStopped();
void handleIncomingMidiMessage (MidiInput* source, const MidiMessage& message);
void changeListenerCallback (void*);
//==============================================================================
static int compareElements (FilterInGraph* const first, FilterInGraph* const second) throw();
const float** inputChannelData;
int totalNumInputChannels;
float** outputChannelData;
int totalNumOutputChannels;
MidiBuffer incomingMidi;
MidiKeyboardState keyState;
MidiMessageCollector messageCollector;
//==============================================================================
class PlayerAwareFilter
{
public:
virtual void setPlayer (FilterGraphPlayer* newPlayer) = 0;
};
private:
FilterGraph& graph;
CriticalSection processLock;
double sampleRate;
int blockSize;
AudioDeviceManager* deviceManager;
ReferenceCountedArray <FilterInGraph> filters;
OwnedArray <FilterConnection> connections;
void update();
FilterGraphPlayer (const FilterGraphPlayer&);
const FilterGraphPlayer& operator= (const FilterGraphPlayer&);
};
*/
#endif

View file

@ -30,7 +30,7 @@
*/
/*
This file contains settings that you might want to explicitly apply to
This file contains settings that you might want to explicitly apply to
the your build.
Most of these are turned on or off by default, but you can override

View file

@ -1,10 +1,10 @@
/*
/*
This file includes the entire juce source tree via the amalgamated file.
You could add the amalgamated file directly to your project, but doing it
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
the source code.
*/

View file

@ -7969,4 +7969,3 @@ static const unsigned char temp17[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61
111,109,109,97,110,100,77,97,110,97,103,101,114,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,87,105,100,103,101,116,
115,68,101,109,111,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,59,13,10,125,13,10,0,0};
const char* BinaryData::widgetsdemo_cpp = (const char*) temp17;

View file

@ -1,129 +1,129 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_QUICKTIME && ! JUCE_LINUX
//==============================================================================
// so that we can easily have two QT windows each with a file browser, wrap this up as a class..
class QuickTimeWindowWithFileBrowser : public Component,
public FilenameComponentListener
{
public:
QuickTimeWindowWithFileBrowser()
{
addAndMakeVisible (qtComp = new QuickTimeMovieComponent());
// and a file-chooser..
addAndMakeVisible (fileChooser = new FilenameComponent (T("movie"),
File::nonexistent,
true, false, false,
T("*.*"),
String::empty,
T("(choose a video file to play)")));
fileChooser->addListener (this);
fileChooser->setBrowseButtonText (T("browse"));
}
~QuickTimeWindowWithFileBrowser()
{
deleteAllChildren();
}
void resized()
{
qtComp->setBounds (0, 0, getWidth(), getHeight() - 30);
fileChooser->setBounds (0, getHeight() - 24, getWidth(), 24);
}
void filenameComponentChanged (FilenameComponent*)
{
// this is called when the user changes the filename in the file chooser box
if (qtComp->loadMovie (fileChooser->getCurrentFile(), true))
{
// loaded the file ok, so let's start it playing..
qtComp->play();
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Couldn't load the file!"),
T("Sorry, QuickTime didn't manage to load that file!"));
}
}
private:
QuickTimeMovieComponent* qtComp;
FilenameComponent* fileChooser;
};
//==============================================================================
class QuickTimeDemo : public Component
{
public:
//==============================================================================
QuickTimeDemo()
{
setName (T("QuickTime"));
// add a movie component..
addAndMakeVisible (qtComp1 = new QuickTimeWindowWithFileBrowser());
addAndMakeVisible (qtComp2 = new QuickTimeWindowWithFileBrowser());
}
~QuickTimeDemo()
{
deleteAllChildren();
}
void resized()
{
qtComp1->setBoundsRelative (0.05f, 0.05f, 0.425f, 0.9f);
qtComp2->setBoundsRelative (0.525f, 0.05f, 0.425f, 0.9f);
}
private:
//==============================================================================
QuickTimeWindowWithFileBrowser* qtComp1;
QuickTimeWindowWithFileBrowser* qtComp2;
};
//==============================================================================
Component* createQuickTimeDemo()
{
return new QuickTimeDemo();
}
#endif
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_QUICKTIME && ! JUCE_LINUX
//==============================================================================
// so that we can easily have two QT windows each with a file browser, wrap this up as a class..
class QuickTimeWindowWithFileBrowser : public Component,
public FilenameComponentListener
{
public:
QuickTimeWindowWithFileBrowser()
{
addAndMakeVisible (qtComp = new QuickTimeMovieComponent());
// and a file-chooser..
addAndMakeVisible (fileChooser = new FilenameComponent (T("movie"),
File::nonexistent,
true, false, false,
T("*.*"),
String::empty,
T("(choose a video file to play)")));
fileChooser->addListener (this);
fileChooser->setBrowseButtonText (T("browse"));
}
~QuickTimeWindowWithFileBrowser()
{
deleteAllChildren();
}
void resized()
{
qtComp->setBounds (0, 0, getWidth(), getHeight() - 30);
fileChooser->setBounds (0, getHeight() - 24, getWidth(), 24);
}
void filenameComponentChanged (FilenameComponent*)
{
// this is called when the user changes the filename in the file chooser box
if (qtComp->loadMovie (fileChooser->getCurrentFile(), true))
{
// loaded the file ok, so let's start it playing..
qtComp->play();
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Couldn't load the file!"),
T("Sorry, QuickTime didn't manage to load that file!"));
}
}
private:
QuickTimeMovieComponent* qtComp;
FilenameComponent* fileChooser;
};
//==============================================================================
class QuickTimeDemo : public Component
{
public:
//==============================================================================
QuickTimeDemo()
{
setName (T("QuickTime"));
// add a movie component..
addAndMakeVisible (qtComp1 = new QuickTimeWindowWithFileBrowser());
addAndMakeVisible (qtComp2 = new QuickTimeWindowWithFileBrowser());
}
~QuickTimeDemo()
{
deleteAllChildren();
}
void resized()
{
qtComp1->setBoundsRelative (0.05f, 0.05f, 0.425f, 0.9f);
qtComp2->setBoundsRelative (0.525f, 0.05f, 0.425f, 0.9f);
}
private:
//==============================================================================
QuickTimeWindowWithFileBrowser* qtComp1;
QuickTimeWindowWithFileBrowser* qtComp2;
};
//==============================================================================
Component* createQuickTimeDemo()
{
return new QuickTimeDemo();
}
#endif

View file

@ -1,129 +1,129 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_QUICKTIME && ! JUCE_LINUX
//==============================================================================
// so that we can easily have two QT windows each with a file browser, wrap this up as a class..
class QuickTimeWindowWithFileBrowser : public Component,
public FilenameComponentListener
{
public:
QuickTimeWindowWithFileBrowser()
{
addAndMakeVisible (qtComp = new QuickTimeMovieComponent());
// and a file-chooser..
addAndMakeVisible (fileChooser = new FilenameComponent (T("movie"),
File::nonexistent,
true, false, false,
T("*.*"),
String::empty,
T("(choose a video file to play)")));
fileChooser->addListener (this);
fileChooser->setBrowseButtonText (T("browse"));
}
~QuickTimeWindowWithFileBrowser()
{
deleteAllChildren();
}
void resized()
{
qtComp->setBounds (0, 0, getWidth(), getHeight() - 30);
fileChooser->setBounds (0, getHeight() - 24, getWidth(), 24);
}
void filenameComponentChanged (FilenameComponent*)
{
// this is called when the user changes the filename in the file chooser box
if (qtComp->loadMovie (fileChooser->getCurrentFile(), true))
{
// loaded the file ok, so let's start it playing..
qtComp->play();
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Couldn't load the file!"),
T("Sorry, QuickTime didn't manage to load that file!"));
}
}
private:
QuickTimeMovieComponent* qtComp;
FilenameComponent* fileChooser;
};
//==============================================================================
class QuickTimeDemo : public Component
{
public:
//==============================================================================
QuickTimeDemo()
{
setName (T("QuickTime"));
// add a movie component..
addAndMakeVisible (qtComp1 = new QuickTimeWindowWithFileBrowser());
addAndMakeVisible (qtComp2 = new QuickTimeWindowWithFileBrowser());
}
~QuickTimeDemo()
{
deleteAllChildren();
}
void resized()
{
qtComp1->setBoundsRelative (0.05f, 0.05f, 0.425f, 0.9f);
qtComp2->setBoundsRelative (0.525f, 0.05f, 0.425f, 0.9f);
}
private:
//==============================================================================
QuickTimeWindowWithFileBrowser* qtComp1;
QuickTimeWindowWithFileBrowser* qtComp2;
};
//==============================================================================
Component* createQuickTimeDemo()
{
return new QuickTimeDemo();
}
#endif
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
JUCE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_QUICKTIME && ! JUCE_LINUX
//==============================================================================
// so that we can easily have two QT windows each with a file browser, wrap this up as a class..
class QuickTimeWindowWithFileBrowser : public Component,
public FilenameComponentListener
{
public:
QuickTimeWindowWithFileBrowser()
{
addAndMakeVisible (qtComp = new QuickTimeMovieComponent());
// and a file-chooser..
addAndMakeVisible (fileChooser = new FilenameComponent (T("movie"),
File::nonexistent,
true, false, false,
T("*.*"),
String::empty,
T("(choose a video file to play)")));
fileChooser->addListener (this);
fileChooser->setBrowseButtonText (T("browse"));
}
~QuickTimeWindowWithFileBrowser()
{
deleteAllChildren();
}
void resized()
{
qtComp->setBounds (0, 0, getWidth(), getHeight() - 30);
fileChooser->setBounds (0, getHeight() - 24, getWidth(), 24);
}
void filenameComponentChanged (FilenameComponent*)
{
// this is called when the user changes the filename in the file chooser box
if (qtComp->loadMovie (fileChooser->getCurrentFile(), true))
{
// loaded the file ok, so let's start it playing..
qtComp->play();
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Couldn't load the file!"),
T("Sorry, QuickTime didn't manage to load that file!"));
}
}
private:
QuickTimeMovieComponent* qtComp;
FilenameComponent* fileChooser;
};
//==============================================================================
class QuickTimeDemo : public Component
{
public:
//==============================================================================
QuickTimeDemo()
{
setName (T("QuickTime"));
// add a movie component..
addAndMakeVisible (qtComp1 = new QuickTimeWindowWithFileBrowser());
addAndMakeVisible (qtComp2 = new QuickTimeWindowWithFileBrowser());
}
~QuickTimeDemo()
{
deleteAllChildren();
}
void resized()
{
qtComp1->setBoundsRelative (0.05f, 0.05f, 0.425f, 0.9f);
qtComp2->setBoundsRelative (0.525f, 0.05f, 0.425f, 0.9f);
}
private:
//==============================================================================
QuickTimeWindowWithFileBrowser* qtComp1;
QuickTimeWindowWithFileBrowser* qtComp2;
};
//==============================================================================
Component* createQuickTimeDemo()
{
return new QuickTimeDemo();
}
#endif

View file

@ -30,7 +30,7 @@
*/
/*
This file contains settings that you might want to explicitly apply to
This file contains settings that you might want to explicitly apply to
the your build.
Most of these are turned on or off by default, but you can override

View file

@ -1,10 +1,10 @@
/*
/*
This file includes the entire juce source tree via the amalgamated file.
You could add the amalgamated file directly to your project, but doing it
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
the source code.
*/

View file

@ -911,4 +911,3 @@ static const unsigned char temp4[] = {137,80,78,71,13,10,26,10,0,0,0,13,73,72,68
0,98,28,9,155,95,0,2,104,68,236,11,1,8,160,17,225,73,128,0,3,0,120,52,172,151,198,78,252,63,0,0,0,0,73,69,78,68,174,66,
96,130,0,0};
const char* BinaryData::prefs_misc_png = (const char*) temp4;

View file

@ -30,7 +30,7 @@
*/
/*
This file contains settings that you might want to explicitly apply to
This file contains settings that you might want to explicitly apply to
the your build.
Most of these are turned on or off by default, but you can override

View file

@ -1,10 +1,10 @@
/*
/*
This file includes the entire juce source tree via the amalgamated file.
You could add the amalgamated file directly to your project, but doing it
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
the source code.
*/

View file

@ -362,7 +362,7 @@ void positionToCode (const RelativePositionedRectangle& position,
positionToCode (ComponentTypeHandler::getComponentPosition (relCompW), layout, wrx, wry, wrw, wrh);
String hrx, hry, hrw, hrh;
Component* const relCompH = (layout != 0 && position.rect.getHeightMode() != PositionedRectangle::absoluteSize)
Component* const relCompH = (layout != 0 && position.rect.getHeightMode() != PositionedRectangle::absoluteSize)
? layout->findComponentWithId (position.relativeToH) : 0;
if (relCompH != 0)
positionToCode (ComponentTypeHandler::getComponentPosition (relCompH), layout, hrx, hry, hrw, hrh);