31,19 €
There are a number of frameworks available for developing cross-platform applications. JUCE achieves this with a combination of consistency, ease-of-use, and breadth of functionality. JUCE is a C++ toolkit for building cross-platform applications on PC, Mac, Linux, iOS, and Android. It encourages you to write consistent code and is particularly good for complex, customized GUIs and audio/midi processing; it also includes a vast range of classes to help with all your day-to-day programming tasks.
Getting started with JUCE is a practical, hands-on guide to developing applications using JUCE which will help you get started with many of the core aspects of the JUCE library. The book guides you through the installation of JUCE and covers the structure of the source code tree including some of the useful tools available for creating JUCE projects.
Getting started with JUCE will guide you through how to use the JUCE library, from the installation of basic tools to developing examples using many of its classes. It will take you through a series of practical examples that show you how to create user interfaces, illustrating the key features.
You will also learn how to deal with files, text strings, and other fundamental data using the JUCE library. In particular, you will learn how to create user interfaces both using code and using the Introjucer tool to layout and configure user interface functionality. You will also manipulate image and audio data and learn how to read and write common media file formats. With this book, you will learn everything you need to know to understand some of the additional helpful utilities offered by JUCE and how to use the JUCE documentation to get started with such classes.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 161
Veröffentlichungsjahr: 2013
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2013
Production Reference: 1211013
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-331-6
www.packtpub.com
Cover Image by Aniket Sawant (<[email protected]>)
Author
Martin Robinson
Reviewers
Michael Hetrick
Liam Lacey
Owen S. Vallis
Acquisition Editors
Ashwin Nair
Usha Iyer
Lead Technical Editor
Mohammed Fahad
Technical Editor
Menza Mathew
Project Coordinator
Suraj Bist
Proofreader
Clyde Jenkins
Indexer
Hemangini Bari
Graphics
Yuvraj Mannari
Production Coordinator
Pooja Chiplunkar
Cover Work
Pooja Chiplunkar
Martin Robinson is a British University Lecturer, software developer, composer, and an artist. He lectures in Music Technology with particular interests in audio software development and game audio. He gained his B.A. (Hons) Music and Music Technology from Middlesex University with first class honors, specializing in music composition. Later, he gained his M.A. Electronic Arts (with distinction) where his thesis focused on developing a system for employing artificial neural networks for controlling audio-visual systems.
His interest in computer programming developed through his music composition practice and his desire to customize systems for manipulating music and audio. He developed the UGen++ library for developing audio applications that was based on the look and feel of the SuperCollider audio programming language. Later, he developed the Plink|Plonk|Plank libraries too, for audio application development. He also develops iOS applications.
I would like to thank my wife Catherine and my two children, Mia and Esme, for their support, especially on writing days.
Michael Hetrick (born in 1988) is a Ph.D. student in the Media Arts and Technology department at UC, Santa Barbara. A lifelong musician, he discovered his passion for electronic music while studying at Western Reserve Academy. At Vanderbilt University, he expanded his work into the field of video art while receiving a B.A. in Digital Media and Distribution. He went on to receive an M.A. in Electronic Music and Sound Design at UC, Santa Barbara in 2011 while doing research in chaotic synthesis under Curtis Roads, Clarence Barlow, Matthew Wright, and Marcos Novak. He is the co-owner and co-founder of Unfiltered Audio, a company dedicated to creating new software for digital musicians everywhere. His current research is focused on new paradigms for microsound. You can find his work at http://mhetrick.com.
Liam Lacey graduated from the University of the West of England, Bristol, UK in 2010 with a first-class B.Sc. (Hons) degree in Audio and Music Technology. Since then he has become the lead software developer for Bristol-based company nu desine, which develops the new electronic musical instrument—the AlphaSphere.
Liam's main interests are within the fields of music interaction and electronic musical instrument design. He recently attended the annual New Interfaces for Music Expression 2013 conference, where he co-authored and presented a paper on the design of the AlphaSphere. In his spare time he is also a musician, producer, composer, and performer, as well as likes getting involved in various programming projects.
Liam has been using JUCE, for more than two years, as the main library for all software that he develops, due to its ease for creating cross-platform GUI applications, and it has been the perfect framework for developing the AlphaSphere software due to JUCE's strong audio and MIDI support.
Owen S. Vallis is currently a professor of Music Technology at the California Institute of the Arts, Music Technology: Interaction, Intelligence, and Design program. He is a musician, artist, and scientist interested in performance, sound, and technology. As a co-founder of Flipmu and The NOISE INDEX, he explores a diverse range of projects including big data research, sound art installations, producing and composing, designing audio processors, and creating new hardware interfaces for musical performance. He received his Ph.D. in 2013 at the New Zealand School of Music, Victoria University of Wellington, and explored contemporary approaches to live computer music. During his graduate research, Owen focused on developing new musical interfaces, interactive musical agents, and large networked music ensembles. He graduated with a B.A. in Music Technology from the California Institute of the Arts in 2008.
Having lived in Toronto, Canada; Wellington, New Zealand; Tokyo, Japan; San Francisco, Nashville, and Los Angeles, Owen has been able to develop a broad and interesting cross section of musical ideologies and aesthetics. Over the past 10 years, he has worked as a research scientist for Twitter, developed multi-touch interfaces for Nokia research labs, worked for leading ribbon microphone manufacturer Royer Labs, has had musical production featured in major motion films, built a recording facility, and produced, engineered, and mixed records in Tokyo, Nashville, and Los Angeles. Owen's work has been featured in Wired, Future Music, Pitchfork, XLR8R, Processing.org, computer arts magazine, and shown at events such as NASA's Yuri's Night, Google I/O, and the New York Cutlog art festival.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
JUCE is a framework for developing cross-platform software in C++. JUCE itself comprises of a wide range of classes that solve common problems encountered when developing software systems. These include handling graphics, sound, user interaction, networks, and so on. Due to its level of audio support JUCE is popular for developing audio applications and audio plugins, although this is by no means limits its use to this domain. It is relatively easy to get started with JUCE, and each JUCE class offers few surprises. At the same time, JUCE is powerful and customizable with little effort.
Chapter 1, Installing JUCE and the Introjucer Application, guides the user through installing JUCE and covers the structure of the source code tree, including some of the useful tools available for creating JUCE projects. By the end of this chapter, the user will have installed JUCE, created a basic project using the Introjucer application and be familiar with the JUCE documentation.
Chapter 2, Building User Interfaces, covers the JUCE Component class, which is the main building block for creating graphical user interfaces in JUCE. By the end of this chapter, the user will be able to create basic user interfaces and perform fundamental drawing within a component. The user will also have the skills required to design and build more complex interfaces.
Chapter 3, Essential Data Structures, describes JUCE's important data structures, many of which could be seen as replacements for some of the standard library classes. This chapter also introduces the essential classes for JUCE development. By the end of this chapter, the user will be able to create and manipulate data in a range of JUCE's essential classes.
Chapter 4, Using Media Files. JUCE provides its own classes for reading and writing files and many helper classes for specific media formats. This chapter introduces the main examples of these classes. By the end of this chapter, the user will be able to manipulate a range of media files using JUCE.
Chapter 5, Helpful Utilities. In addition to the essential classes introduced in earlier chapters, JUCE includes a range of classes for solving common problems in application development. By the end of this chapter, the user will have an awareness of some of the additional, helpful utilities offered by JUCE.
You will need a Mac OS X or Windows computer that supports an appropriate Integrated Development Environment (IDE). Any relatively recent computer should be sufficient. On Mac OS X, you should be running the Mac OS X 10.7 "Lion" operating system (or later). Most relatively recent Windows computers will support an appropriate version of the Microsoft Visual Studio IDE. Setting up the IDE for JUCE development is covered in Chapter 1, Installing JUCE and the Introjucer Application.
This book is for programmers with a basic grasp of C++. The examples start from a basic level, making few assumptions beyond fundamental C++ concepts. For example, not even an understanding of the C++ Standard Library is needed. Those without any experience with C++ should be able to follow and construct the examples, although may need further support to understand the fundamental concepts. Experienced programmers should also find they get to grips the JUCE library more quickly.
In this book, you will find a number of styles of text that distinguish among different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "We can include other contexts through the use of the include directive."
A block of code is set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking the Next button moves you to the next screen".
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
This chapter guides you through installing the JUCE library, and covers the structure of its source code tree, including some of the useful tools available for creating JUCE-based projects. In this chapter we will cover the following topics:
By the end of this chapter, you will have installed JUCE and created a basic project using the Introjucer application.
JUCEsupports the development of C++ applications for a range of target platforms. These include Microsoft Windows, Mac OS X, iOS, Linux, and Android. In general, this book covers the development of C++ applications using JUCE for Windows and Mac OS X, but it is relatively straightforward to apply this knowledge to build applications for the other supported target platforms.
In order to compile JUCE-based code for these platforms, typically an Integrated Development Environment (IDE) is required. To compile code for Windows, the Microsoft Visual Studio IDE is recommended (supported variants are Microsoft Visual Studio 2008, 2010, and 2012). Microsoft Visual Studio is available to download from http://www.microsoft.com/visualstudio (the free Express versions are sufficient for non-commercial development). To compile code for Mac OS X or iOS, the Xcode IDE is required. Generally, the latest public version of Xcode is recommended. This can be downloaded for free from the Mac App Store from within Mac OS X.
JUCE is provided as source code (rather than prebuilt libraries) divided into discrete but interconnected modules. The juce_core module is licensed under the Internet Systems Consortium (ISC) license, allowing it to be used freely in commercial and open source projects. All the other JUCE modules are dual licensed. For open source development, JUCE may be licensed under the terms of the GNU General Public License (Version 2 or later) or the Affero General Public License (Version 3). JUCE may also be used for closed-source, commercial projects using separate commercial licenses for a fee. More information on JUCE licensing is available at http://www.juce.com/documentation/commercial-licensing.
Unless there are very specific reasons for using a particular version of JUCE, it is recommended to use the current development version available from the project's GIT repository. This version is almost always kept stable and often includes useful new features and bug fixes. The source code is available for download, using any GIT client software, at git://github.com/julianstorer/JUCE.git or git://git.code.sf.net/p/juce/code. Alternatively, the code for the current development version may be downloaded as a ZIP file from https://github.com/julianstorer/JUCE/archive/master.zip.
You should keep the JUCE source code in its top-level juce directory, but you should move this directory to a sensible location on your system that suits your workflow. The juce directory has the following structure (directories are shown using a trailing /):
Although all of these files are important, and the actual code for the JUCE library itself is located in the juce/modules directory, each module is contained within its own subdirectory. For example, the juce_core module mentioned previously is in the juce/modules/juce_core