2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-9 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "../jucedemo_headers.h"
28 #if JUCE_QUICKTIME && ! JUCE_LINUX
30 //==============================================================================
31 // so that we can easily have two QT windows each with a file browser, wrap this up as a class..
32 class QuickTimeWindowWithFileBrowser
: public Component
,
33 public FilenameComponentListener
36 QuickTimeWindowWithFileBrowser()
37 : fileChooser ("movie", File::nonexistent
, true, false, false,
38 "*", String::empty
, "(choose a video file to play)")
40 addAndMakeVisible (&qtComp
);
42 addAndMakeVisible (&fileChooser
);
43 fileChooser
.addListener (this);
44 fileChooser
.setBrowseButtonText ("browse");
47 ~QuickTimeWindowWithFileBrowser()
53 qtComp
.setBounds (0, 0, getWidth(), getHeight() - 30);
54 fileChooser
.setBounds (0, getHeight() - 24, getWidth(), 24);
57 void filenameComponentChanged (FilenameComponent
*)
59 // this is called when the user changes the filename in the file chooser box
60 if (qtComp
.loadMovie (fileChooser
.getCurrentFile(), true))
62 // loaded the file ok, so let's start it playing..
68 AlertWindow::showMessageBox (AlertWindow::WarningIcon
,
69 "Couldn't load the file!",
70 "Sorry, QuickTime didn't manage to load that file!");
75 QuickTimeMovieComponent qtComp
;
76 FilenameComponent fileChooser
;
80 //==============================================================================
81 class QuickTimeDemo
: public Component
84 //==============================================================================
87 setName ("QuickTime");
89 // add a movie component..
90 addAndMakeVisible (&qtComp1
);
91 addAndMakeVisible (&qtComp2
);
96 qtComp1
.setVisible (false);
97 qtComp2
.setVisible (false);
102 qtComp1
.setBoundsRelative (0.05f
, 0.05f
, 0.425f
, 0.9f
);
103 qtComp2
.setBoundsRelative (0.525f
, 0.05f
, 0.425f
, 0.9f
);
107 //==============================================================================
108 QuickTimeWindowWithFileBrowser qtComp1
, qtComp2
;
112 //==============================================================================
113 Component
* createQuickTimeDemo()
115 return new QuickTimeDemo();