diff --git a/Doxyfile.in b/Doxyfile.in index 2754b40f..18786a70 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -716,7 +716,9 @@ EXCLUDE_SYMLINKS = NO # for example use the pattern */test/* EXCLUDE_PATTERNS = "*/.*" \ - "*/.*/*" + "*/.*/*" \ + "*/src/Main.cpp*" \ + "*/src/Main_Blackmagic.cpp*" # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/include/Cache.h b/include/Cache.h index 0bd9bc66..626f42e9 100644 --- a/include/Cache.h +++ b/include/Cache.h @@ -101,7 +101,7 @@ namespace openshot { /// @param frame_number The frame number of the cached frame void Remove(int frame_number); - /// @breif Set maximum bytes to a different amount + /// @brief Set maximum bytes to a different amount /// @param number_of_bytes The maximum bytes to allow in the cache. Once exceeded, the cache will purge the oldest frames. void SetMaxBytes(int64 number_of_bytes) { max_bytes = number_of_bytes; CleanUp(); }; diff --git a/include/ChunkWriter.h b/include/ChunkWriter.h index 4d363df2..e04540cc 100644 --- a/include/ChunkWriter.h +++ b/include/ChunkWriter.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_CHUNK_WRITER_H -#define OPENSHOT_CHUNK_WRITER_H - /** * @file * @brief Header file for ChunkWriter class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_CHUNK_WRITER_H +#define OPENSHOT_CHUNK_WRITER_H + #include "ReaderBase.h" #include "WriterBase.h" #include "FFmpegWriter.h" @@ -85,7 +106,7 @@ namespace openshot public: - /// @breif Constructor for ChunkWriter. Throws one of the following exceptions. + /// @brief Constructor for ChunkWriter. Throws one of the following exceptions. /// @param path The folder path of the chunk file to be created /// @param reader The initial reader to base this chunk file's meta data on (such as fps, height, width, etc...) ChunkWriter(string path, ReaderBase *reader) throw(InvalidFile, InvalidFormat, InvalidCodec, InvalidOptions, OutOfMemory); @@ -96,20 +117,20 @@ namespace openshot /// Get the chunk size (number of frames to write in each chunk) int GetChunkSize() { return chunk_size; }; - /// @breif Set the chunk size (number of frames to write in each chunk) + /// @brief Set the chunk size (number of frames to write in each chunk) /// @param new_size The number of frames to write in this chunk file int SetChunkSize(int new_size) { chunk_size = new_size; }; - /// @breif Add a frame to the stack waiting to be encoded. + /// @brief Add a frame to the stack waiting to be encoded. /// @param frame The openshot::Frame object that needs to be written to this chunk file. void WriteFrame(tr1::shared_ptr frame); - /// @breif Write a block of frames from a reader + /// @brief Write a block of frames from a reader /// @param start The starting frame number to write (of the reader passed into the constructor) /// @param length The number of frames to write (of the reader passed into the constructor) void WriteFrame(int start, int length); - /// @breif Write a block of frames from a reader + /// @brief Write a block of frames from a reader /// @param reader The reader containing the frames you need /// @param start The starting frame number to write /// @param length The number of frames to write diff --git a/include/Color.h b/include/Color.h index 0dfff2d9..dc7aada7 100644 --- a/include/Color.h +++ b/include/Color.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_COLOR_H -#define OPENSHOT_COLOR_H - /** * @file * @brief Header file for Color class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_COLOR_H +#define OPENSHOT_COLOR_H + #include "KeyFrame.h" namespace openshot { @@ -19,8 +40,8 @@ namespace openshot { */ struct Color{ Keyframe red; /// + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_COORDINATE_H +#define OPENSHOT_COORDINATE_H + #include "../include/Fraction.h" namespace openshot { @@ -26,18 +47,43 @@ namespace openshot { * \endcode */ class Coordinate { - public: - float X; ///< The X value of the coordinate - float Y; ///< The Y value of the coordinate + private: bool increasing; ///< Is the Y value increasing or decreasing? Fraction repeated; ///< Fraction of repeated Y values (for example, 1/3 would be the first Y value of 3 repeated values) float delta; ///< This difference in Y value (from the previous unique Y value) + public: + float X; ///< The X value of the coordinate (usually representing the frame #) + float Y; ///< The Y value of the coordinate (usually representing the value of the property being animated) + /// The default constructor, which defaults to (0,0) Coordinate(); - /// Constructor which also sets the X and Y + /// @brief Constructor which also sets the X and Y + /// @param x The X coordinate (usually representing the frame #) + /// @param y The Y coordinate (usually representing the value of the property being animated) Coordinate(float x, float y); + + /// @brief Set the repeating Fraction (used internally on the timeline, to track changes to coordinates) + /// @param repeated The fraction representing how many times this coordinate Y value repeats (only used on the timeline) + void Repeat(Fraction repeated) { repeated=repeated; } + + /// Get the repeating Fraction (used internally on the timeline, to track changes to coordinates) + Fraction Repeat() { return repeated; } + + /// @brief Set the increasing flag (used internally on the timeline, to track changes to coordinates) + /// @param increasing Indicates if this coorindate Y value is increasing (when compared to the previous coordinate) + void IsIncreasing(bool increasing) { increasing=increasing; } + + /// Get the increasing flag (used internally on the timeline, to track changes to coordinates) + bool IsIncreasing() { return increasing; } + + /// @brief Set the delta / difference between previous coordinate value (used internally on the timeline, to track changes to coordinates) + /// @param delta Indicates how much this Y value differs from the previous Y value + void Delta(float delta) { delta=delta; } + + /// Get the delta / difference between previous coordinate value (used internally on the timeline, to track changes to coordinates) + float Delta() { return delta; } }; } diff --git a/include/DecklinkReader.h b/include/DecklinkReader.h index 82481d4f..c0b6b74f 100644 --- a/include/DecklinkReader.h +++ b/include/DecklinkReader.h @@ -104,7 +104,7 @@ namespace openshot /// is ignored, since it always gets the latest LIVE frame. /// /// @returns The requested frame (containing the image) - /// @param[requested_frame] number The frame number that is requested. + /// @param requested_frame The frame number that is requested. tr1::shared_ptr GetFrame(int requested_frame) throw(ReaderClosed); unsigned long GetCurrentFrameNumber(); diff --git a/include/DummyReader.h b/include/DummyReader.h index cd461fe8..a7cd0aec 100644 --- a/include/DummyReader.h +++ b/include/DummyReader.h @@ -75,7 +75,7 @@ namespace openshot /// return the same Frame, since they all share the same image data. /// /// @returns The requested frame (containing the image) - /// @param[requested_frame] number The frame number that is requested. + /// @param requested_frame The frame number that is requested. tr1::shared_ptr GetFrame(int requested_frame) throw(ReaderClosed); /// Open File - which is called by the constructor automatically diff --git a/include/Exceptions.h b/include/Exceptions.h index e7dcd377..94c9d7d3 100644 --- a/include/Exceptions.h +++ b/include/Exceptions.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_EXCEPTIONS_H -#define OPENSHOT_EXCEPTIONS_H - /** * @file * @brief Header file for all Exception classes - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_EXCEPTIONS_H +#define OPENSHOT_EXCEPTIONS_H + #include using namespace std; diff --git a/include/FFmpegReader.h b/include/FFmpegReader.h index 6510d2ad..cb67ed23 100644 --- a/include/FFmpegReader.h +++ b/include/FFmpegReader.h @@ -1,16 +1,19 @@ /** * @file * @brief Header file for FFmpegReader class - * @author Jonathan Thomas + * @author Jonathan Thomas , Fabrice Bellard * * @section LICENSE * - * Copyright (c) 2008-2013 OpenShot Studios, LLC + * Copyright (c) 2008-2013 OpenShot Studios, LLC, Fabrice Bellard * (http://www.openshotstudios.com). This file is part of * OpenShot Library (http://www.openshot.org), an open-source project * dedicated to delivering high quality video editing and animation solutions * to the world. * + * This file is originally based on the Libavformat API example, and then modified + * by the libopenshot project. + * * OpenShot Library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -25,7 +28,6 @@ * along with OpenShot Library. If not, see . */ - #ifndef OPENSHOT_FFMPEG_READER_H #define OPENSHOT_FFMPEG_READER_H @@ -71,6 +73,23 @@ namespace openshot * method. To use this reader, simply create an instance of this class, and call the GetFrame method * to start retrieving frames. Use the info struct to obtain info on the file, such as the length * (in frames), height, width, bitrate, frames per second (fps), etc... + * + * @code + * // Create a reader for a video + * FFmpegReader r("MyAwesomeVideo.webm"); + * r.Open(); // Open the reader + * + * // Get frame number 1 from the video + * tr1::shared_ptr f = r.GetFrame(1); + * + * // Now that we have an openshot::Frame object, lets have some fun! + * f->Display(); // Display the frame on the screen + * f->DisplayWaveform(); // Display the audio waveform as an image + * f->Play(); // Play the audio through your speaker + * + * // Close the reader + * r.Close(); + * @endcode */ class FFmpegReader : public ReaderBase { diff --git a/include/FFmpegUtilities.h b/include/FFmpegUtilities.h index 9e2d02b2..abb7310e 100644 --- a/include/FFmpegUtilities.h +++ b/include/FFmpegUtilities.h @@ -1,3 +1,30 @@ +/** + * @file + * @brief Header file for FFmpegUtilities + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #ifndef OPENSHOT_FFMPEG_UTILITIES_H #define OPENSHOT_FFMPEG_UTILITIES_H diff --git a/include/FFmpegWriter.h b/include/FFmpegWriter.h index b2cc232b..cdc055d7 100644 --- a/include/FFmpegWriter.h +++ b/include/FFmpegWriter.h @@ -1,12 +1,37 @@ -#ifndef OPENSHOT_FFMPEG_WRITER_H -#define OPENSHOT_FFMPEG_WRITER_H - /** * @file * @brief Header file for FFmpegWriter class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas , Fabrice Bellard + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC, Fabrice Bellard + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * This file is originally based on the Libavformat API example, and then modified + * by the libopenshot project. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ + +#ifndef OPENSHOT_FFMPEG_WRITER_H +#define OPENSHOT_FFMPEG_WRITER_H + #include "ReaderBase.h" #include "WriterBase.h" @@ -38,7 +63,40 @@ namespace openshot }; /** - * @brief This class uses the FFmpeg libraries, to write and encode video files and audio files + * @brief This class uses the FFmpeg libraries, to write and encode video files and audio files. + * + * All FFmpeg options can be set using the SetOption() method, and any Reader may be used + * to generate openshot::Frame objects needed for writing. Be sure to use valid bit rates, frame + * rates, and sample rates (each format / codec has a limited # of valid options). + * + * @code + * // Create a reader for a video + * FFmpegReader r("MyAwesomeVideo.webm"); + * r.Open(); // Open the reader + * + * // Create a writer (which will create a WebM video) + * FFmpegWriter w("/home/jonathan/NewVideo.webm"); + * + * // Set options + * w.SetAudioOptions(true, "libvorbis", 44100, 2, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000 + * w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000 + * + * // Prepare Streams + * w.PrepareStreams(); + * + * // Write header + * w.WriteHeader(); + * + * // Write all frames from the reader + * w.WriteFrame(&r, 1, r.info.video_length); + * + * // Write Footer + * w.WriteTrailer(); + * + * // Close the reader & writer + * w.Close(); + * r.Close(); + * @endcode */ class FFmpegWriter : public WriterBase { diff --git a/include/Fraction.h b/include/Fraction.h index 23eb29be..98ded891 100644 --- a/include/Fraction.h +++ b/include/Fraction.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_FRACTION_H -#define OPENSHOT_FRACTION_H - /** * @file * @brief Header file for Fraction class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_FRACTION_H +#define OPENSHOT_FRACTION_H + namespace openshot { /** diff --git a/include/Frame.h b/include/Frame.h index d20885df..3a4e2161 100644 --- a/include/Frame.h +++ b/include/Frame.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_FRAME_H -#define OPENSHOT_FRAME_H - /** * @file * @brief Header file for Frame class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_FRAME_H +#define OPENSHOT_FRAME_H + /// Do not include the juce unittest headers, because it collides with unittest++ #ifndef __JUCE_UNITTEST_JUCEHEADER__ #define __JUCE_UNITTEST_JUCEHEADER__ diff --git a/include/FrameMapper.h b/include/FrameMapper.h index 144cd335..ef533227 100644 --- a/include/FrameMapper.h +++ b/include/FrameMapper.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_FRAMEMAPPER_H -#define OPENSHOT_FRAMEMAPPER_H - /** * @file * @brief Header file for the FrameMapper class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_FRAMEMAPPER_H +#define OPENSHOT_FRAMEMAPPER_H + #include #include #include diff --git a/include/FrameRate.h b/include/FrameRate.h index 7514f071..13ba68da 100644 --- a/include/FrameRate.h +++ b/include/FrameRate.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_FRAMERATE_H -#define OPENSHOT_FRAMERATE_H - /** * @file * @brief Header file for the FrameRate class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_FRAMERATE_H +#define OPENSHOT_FRAMERATE_H + #include #include "Fraction.h" diff --git a/include/ImageReader.h b/include/ImageReader.h index f9d00cea..ab001490 100644 --- a/include/ImageReader.h +++ b/include/ImageReader.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_IMAGE_READER_H -#define OPENSHOT_IMAGE_READER_H - /** * @file * @brief Header file for ImageReader class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_IMAGE_READER_H +#define OPENSHOT_IMAGE_READER_H + #include "ReaderBase.h" #include @@ -27,6 +48,21 @@ namespace openshot /** * @brief This class uses the ImageMagick++ libraries, to open image files, and return * openshot::Frame objects containing the image. + * + * @code + * // Create a reader for a video + * ImageReader r("MyAwesomeImage.jpeg"); + * r.Open(); // Open the reader + * + * // Get frame number 1 from the video + * tr1::shared_ptr f = r.GetFrame(1); + * + * // Now that we have an openshot::Frame object, lets have some fun! + * f->Display(); // Display the frame on the screen + * + * // Close the reader + * r.Close(); + * @endcode */ class ImageReader : public ReaderBase { @@ -48,7 +84,7 @@ namespace openshot /// return the same Frame, since they all share the same image data. /// /// @returns The requested frame (containing the image) - /// @param[requested_frame] number The frame number that is requested. + /// @param requested_frame The frame number that is requested. tr1::shared_ptr GetFrame(int requested_frame) throw(ReaderClosed); /// Open File - which is called by the constructor automatically diff --git a/include/Json.h b/include/Json.h index 9c6295f5..95240ae1 100644 --- a/include/Json.h +++ b/include/Json.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_JSON_H -#define OPENSHOT_JSON_H - /** * @file * @brief Header file for JSON class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_JSON_H +#define OPENSHOT_JSON_H + #include "../thirdparty/jsoncpp/include/json/json.h" #endif diff --git a/include/KeyFrame.h b/include/KeyFrame.h index 1a1b7aed..7816860d 100644 --- a/include/KeyFrame.h +++ b/include/KeyFrame.h @@ -1,11 +1,33 @@ +/** + * @file + * @brief Header file for the KeyFrame class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #ifndef OPENSHOT_KEYFRAME_H #define OPENSHOT_KEYFRAME_H -/** - * @file - * @brief Header file for the Keyframe class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC - */ #include #include #include diff --git a/include/OpenShot.h b/include/OpenShot.h index 01b78d99..71e69a91 100644 --- a/include/OpenShot.h +++ b/include/OpenShot.h @@ -3,7 +3,7 @@ /** * @file - * @brief This header includes all commonly used headers for libopenshot, for ease-of-use + * @brief This header includes all commonly used headers for libopenshot, for ease-of-use. * @author Jonathan Thomas * * @mainpage OpenShot Video Editing Library C++ API @@ -55,7 +55,8 @@ * * ### License & Copyright ### * Copyright (c) 2008-2013 OpenShot Studios, LLC - * (http://www.openshotstudios.com). OpenShot Library (http://www.openshot.org) is an open-source project + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project * dedicated to delivering high quality video editing and animation solutions * to the world. * @@ -71,7 +72,6 @@ * * You should have received a copy of the GNU General Public License * along with OpenShot Library. If not, see . - * */ #include "AudioBufferSource.h" diff --git a/include/Player.h b/include/Player.h index 13430ef0..8c6cfb06 100644 --- a/include/Player.h +++ b/include/Player.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_PLAYER_H -#define OPENSHOT_PLAYER_H - /** * @file - * @brief Header file for Frame class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Header file for Player class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_PLAYER_H +#define OPENSHOT_PLAYER_H + #include #include #include "../include/ReaderBase.h" diff --git a/include/Point.h b/include/Point.h index 590f3802..f7d8f7a5 100644 --- a/include/Point.h +++ b/include/Point.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_POINT_H -#define OPENSHOT_POINT_H - /** * @file - * @brief Header file for the Point class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Header file for Point class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_POINT_H +#define OPENSHOT_POINT_H + #include "Coordinate.h" namespace openshot diff --git a/include/ReaderBase.h b/include/ReaderBase.h index d1703385..174302ed 100644 --- a/include/ReaderBase.h +++ b/include/ReaderBase.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_FILE_READER_BASE_H -#define OPENSHOT_FILE_READER_BASE_H - /** * @file * @brief Header file for ReaderBase class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_READER_BASE_H +#define OPENSHOT_READER_BASE_H + #include #include #include diff --git a/include/Sleep.h b/include/Sleep.h index bf886e52..b002fae0 100644 --- a/include/Sleep.h +++ b/include/Sleep.h @@ -1,3 +1,30 @@ +/** + * @file + * @brief Header file for Sleep functions + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #ifndef OPENSHOT_SLEEP_H #define OPENSHOT_SLEEP_H diff --git a/include/TextReader.h b/include/TextReader.h index 0da37334..8e5aa4cd 100644 --- a/include/TextReader.h +++ b/include/TextReader.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_TEXT_READER_H -#define OPENSHOT_TEXT_READER_H - /** * @file * @brief Header file for TextReader class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_TEXT_READER_H +#define OPENSHOT_TEXT_READER_H + #include "ReaderBase.h" #include @@ -31,6 +52,31 @@ namespace openshot * * All system fonts are supported, including many different font properties, such as size, color, * alignment, padding, etc... + * + * @code + * // Create a reader to generate an openshot::Frame containing text + * TextReader r(720, // width + * 480, // height + * 5, // x_offset + * 5, // y_offset + * GRAVITY_CENTER, // gravity + * "Check out this Text!", // text + * "Arial", // font + * 15.0, // size + * "#fff000", // text_color + * "#000000" // background_color + * ); + * r.Open(); // Open the reader + * + * // Get frame number 1 from the video (in fact, any frame # you request will return the same frame) + * tr1::shared_ptr f = r.GetFrame(1); + * + * // Now that we have an openshot::Frame object, lets have some fun! + * f->Display(); // Display the frame on the screen + * + * // Close the reader + * r.Close(); + * @endcode */ class TextReader : public ReaderBase { @@ -51,7 +97,17 @@ namespace openshot public: - /// Constructor for TextReader. + /// @brief Constructor for TextReader. + /// @param width The width of the requested openshot::Frame (not the size of the text) + /// @param height The height of the requested openshot::Frame (not the size of the text) + /// @param x_offset The number of pixels to offset the text on the X axis (horizontal) + /// @param y_offset The number of pixels to offset the text on the Y axis (vertical) + /// @param gravity The alignment / gravity of the text + /// @param text The text you want to generate / display + /// @param font The font of the text + /// @param size The size of the text + /// @param text_color The color of the text + /// @param background_color The background color of the text (also supports Transparent) TextReader(int width, int height, int x_offset, int y_offset, GravityType gravity, string text, string font, double size, string text_color, string background_color); /// Close Reader @@ -61,7 +117,7 @@ namespace openshot /// return the same Frame, since they all share the same image data. /// /// @returns The requested frame (containing the image) - /// @param[requested_frame] number The frame number that is requested. + /// @param requested_frame The frame number that is requested. tr1::shared_ptr GetFrame(int requested_frame) throw(ReaderClosed); /// Open Reader - which is called by the constructor automatically diff --git a/include/Timeline.h b/include/Timeline.h index 7e381593..1c08250a 100644 --- a/include/Timeline.h +++ b/include/Timeline.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_TIMELINE_H -#define OPENSHOT_TIMELINE_H - /** * @file * @brief Header file for Timeline class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_TIMELINE_H +#define OPENSHOT_TIMELINE_H + // Defining some ImageMagic flags... for Mac (since they appear to be unset) #ifndef MAGICKCORE_QUANTUM_DEPTH #define MAGICKCORE_QUANTUM_DEPTH 16 @@ -45,7 +66,56 @@ namespace openshot { * The timeline is one of the most important features of a video editor, and controls all * aspects of how video, image, and audio clips are combined together, and how the final * video output will be rendered. It has a collection of layers and clips, that arrange, - * sequence, and generate the final video output. + * sequence, and generate the final video output. Lets take a look at what the code looks like: + * + * @code + * // Create a Timeline + * Timeline t(1280, // width + * 720, // height + * Framerate(25,1), // framerate + * 44100, // sample rate + * 2 // channels + * ); + * + * // Create some clips + * Clip c1(new ImageReader("MyAwesomeLogo.jpeg")); + * Clip c2(new FFmpegReader("BackgroundVideo.webm")); + * + * // CLIP 1 (logo) - Set some clip properties (with KeyFrames) + * c1.Position(0.0); + * c1.gravity = GRAVITY_LEFT; + * c1.scale = SCALE_CROP; + * c1.Layer(1); + * c1.End(16.0); + * c1.alpha.AddPoint(1, 0.0); + * c1.alpha.AddPoint(500, 0.0); + * c1.alpha.AddPoint(565, 1.0); + * + * // CLIP 2 (background video) - Set some clip properties (with KeyFrames) + * c2.Position(0.0); + * c2.Layer(0); + * c2.alpha.AddPoint(1, 1.0); + * c2.alpha.AddPoint(150, 0.0); + * c2.alpha.AddPoint(360, 0.0, LINEAR); + * c2.alpha.AddPoint(384, 1.0); + * + * // Add clips to timeline + * t.AddClip(&c1); + * t.AddClip(&c2); + * + * // Open the timeline reader + * t.Open(); + * + * // Get frame number 1 from the timeline (This will generate a new frame, made up from the previous clips and settings) + * tr1::shared_ptr f = t.GetFrame(1); + * + * // Now that we have an openshot::Frame object, lets have some fun! + * f->Display(); // Display the frame on the screen + * + * // Close the timeline reader + * t.Close(); + * + * @endcode */ class Timeline : public ReaderBase { private: @@ -79,13 +149,20 @@ namespace openshot { public: - /// Default Constructor for the timeline (which sets the canvas width and height and FPS) + /// @brief Default Constructor for the timeline (which sets the canvas width and height and FPS) + /// @param width The width of the timeline (and thus, the generated openshot::Frame objects) + /// @param height The height of the timeline (and thus, the generated openshot::Frame objects) + /// @param fps The frames rate of the timeline + /// @param sample_rate The sample rate of the timeline's audio + /// @param channels The number of audio channels of the timeline Timeline(int width, int height, Framerate fps, int sample_rate, int channels); - /// Add an openshot::Clip to the timeline + /// @brief Add an openshot::Clip to the timeline + /// @param clip Add an openshot::Clip to the timeline. A clip can contain any type of Reader. void AddClip(Clip* clip); - /// Remove an openshot::Clip to the timeline + /// @brief Remove an openshot::Clip to the timeline + /// @param clip Remove an openshot::Clip from the timeline. void RemoveClip(Clip* clip); /// Close the reader (and any resources it was consuming) @@ -94,19 +171,21 @@ namespace openshot { /// Get the framerate of this timeline Framerate FrameRate() { return fps; }; - /// Set the framerate for this timeline + /// @brief Set the framerate for this timeline + /// @param new_fps The new frame rate to set for this timeline void FrameRate(Framerate new_fps) { fps = new_fps; }; /// Get an openshot::Frame object for a specific frame number of this timeline. /// /// @returns The requested frame (containing the image) - /// @param[requested_frame] number The frame number that is requested. + /// @param requested_frame The frame number that is requested. tr1::shared_ptr GetFrame(int requested_frame) throw(ReaderClosed); /// Get the height of canvas and viewport int Height() { return height; } - /// Set the height of canvas and viewport + /// @brief Set the height of canvas and viewport + /// @param new_height The new height to set for this timeline void Height(int new_height) { height = new_height; } // Curves for the viewport @@ -126,7 +205,8 @@ namespace openshot { /// Get the width of canvas and viewport int Width() { return width; } - /// Set the width of canvas and viewport + /// @brief Set the width of canvas and viewport + /// @param new_width The new width to set for this timeline (i.e. the canvas & viewport) void Width(int new_width) { width = new_width; } }; diff --git a/include/WriterBase.h b/include/WriterBase.h index f6c92e00..f6f99377 100644 --- a/include/WriterBase.h +++ b/include/WriterBase.h @@ -1,12 +1,33 @@ -#ifndef OPENSHOT_FILE_WRITER_BASE_H -#define OPENSHOT_FILE_WRITER_BASE_H - /** * @file * @brief Header file for WriterBase class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ +#ifndef OPENSHOT_WRITER_BASE_H +#define OPENSHOT_WRITER_BASE_H + #include #include #include "Fraction.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 95f32112..46be5fc7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,7 @@ include_directories(${SDL_INCLUDE_DIR}) ################# QT4 ################### # Find QT4 libraries -SET(QT_QMAKE_EXECUTABLE '/usr/bin/qmake-qt4') # DEBUB, WORK-AROUND: Force the use of QT4 (when multiple versions are installed) +#SET(QT_QMAKE_EXECUTABLE '/usr/bin/qmake-qt4') # DEBUB, WORK-AROUND: Force the use of QT4 (when multiple versions are installed) FIND_PACKAGE(Qt4) # Include Qt headers (needed for compile) diff --git a/src/ChunkWriter.cpp b/src/ChunkWriter.cpp index 26c94455..d60f5db6 100644 --- a/src/ChunkWriter.cpp +++ b/src/ChunkWriter.cpp @@ -1,10 +1,30 @@ /** * @file - * @brief Source code for the ChunkWriter class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Source file for ChunkWriter class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ - #include "../include/ChunkWriter.h" using namespace openshot; diff --git a/src/Coordinate.cpp b/src/Coordinate.cpp index 2820beec..b8bb28d1 100644 --- a/src/Coordinate.cpp +++ b/src/Coordinate.cpp @@ -1,7 +1,28 @@ /** * @file - * @brief Source code for the Coordinate class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Source file for Coordinate class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ #include "../include/Coordinate.h" diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index d6f8c26a..1ca3e8c3 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -1,16 +1,19 @@ /** * @file * @brief Source file for FFmpegReader class - * @author Jonathan Thomas + * @author Jonathan Thomas , Fabrice Bellard * * @section LICENSE * - * Copyright (c) 2008-2013 OpenShot Studios, LLC + * Copyright (c) 2008-2013 OpenShot Studios, LLC, Fabrice Bellard * (http://www.openshotstudios.com). This file is part of * OpenShot Library (http://www.openshot.org), an open-source project * dedicated to delivering high quality video editing and animation solutions * to the world. * + * This file is originally based on the Libavformat API example, and then modified + * by the libopenshot project. + * * OpenShot Library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp index d7f4710e..ff6ee70c 100644 --- a/src/FFmpegWriter.cpp +++ b/src/FFmpegWriter.cpp @@ -1,26 +1,31 @@ -/* +/** + * @file + * @brief Source file for FFmpegWriter class + * @author Jonathan Thomas , Fabrice Bellard + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC, Fabrice Bellard + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * * This file is originally based on the Libavformat API example, and then modified * by the libopenshot project. * - * Copyright (c) 2003 Fabrice Bellard, OpenShot Studios, LLC + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * OpenShot Library 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. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with OpenShot Library. If not, see . */ #include "../include/FFmpegWriter.h" diff --git a/src/Fraction.cpp b/src/Fraction.cpp index 8c384fba..1a39a8d5 100644 --- a/src/Fraction.cpp +++ b/src/Fraction.cpp @@ -1,3 +1,30 @@ +/** + * @file + * @brief Source file for Fraction class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #include "../include/Fraction.h" using namespace openshot; diff --git a/src/Frame.cpp b/src/Frame.cpp index 121407aa..96acf9ad 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -1,7 +1,28 @@ /** * @file - * @brief Source code for the Frame class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Source file for Frame class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ #include "../include/Frame.h" diff --git a/src/FrameMapper.cpp b/src/FrameMapper.cpp index d6053f83..9b2137b4 100644 --- a/src/FrameMapper.cpp +++ b/src/FrameMapper.cpp @@ -1,7 +1,28 @@ /** * @file - * @brief Source code for the FrameMapper class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Source file for the FrameMapper class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ #include "../include/FrameMapper.h" diff --git a/src/FrameRate.cpp b/src/FrameRate.cpp index 52905595..87e66d87 100644 --- a/src/FrameRate.cpp +++ b/src/FrameRate.cpp @@ -1,7 +1,28 @@ /** * @file - * @brief Source code for the FrameRate class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Source file for the FrameRate class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ #include "../include/FrameRate.h" diff --git a/src/ImageReader.cpp b/src/ImageReader.cpp index 02e5f15e..f5104152 100644 --- a/src/ImageReader.cpp +++ b/src/ImageReader.cpp @@ -1,3 +1,30 @@ +/** + * @file + * @brief Source file for ImageReader class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #include "../include/ImageReader.h" using namespace openshot; diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index c0fb5c66..e88ce872 100644 --- a/src/KeyFrame.cpp +++ b/src/KeyFrame.cpp @@ -1,7 +1,28 @@ /** * @file - * @brief Source code for the Keyframe class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Source file for the KeyFrame class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ #include "../include/KeyFrame.h" @@ -204,13 +225,13 @@ bool Keyframe::IsIncreasing(int index) // Is index a valid point? if (index >= 0 && index < Values.size()) // Return value - return int(round(Values[index].increasing)); + return int(round(Values[index].IsIncreasing())); else if (index < 0 && Values.size() > 0) // Return the minimum value - return int(round(Values[0].increasing)); + return int(round(Values[0].IsIncreasing())); else if (index >= Values.size() && Values.size() > 0) // return the maximum value - return int(round(Values[Values.size() - 1].increasing)); + return int(round(Values[Values.size() - 1].IsIncreasing())); else // return a blank coordinate (0,0) return true; @@ -226,13 +247,13 @@ Fraction Keyframe::GetRepeatFraction(int index) // Is index a valid point? if (index >= 0 && index < Values.size()) // Return value - return Values[index].repeated; + return Values[index].Repeat(); else if (index < 0 && Values.size() > 0) // Return the minimum value - return Values[0].repeated; + return Values[0].Repeat(); else if (index >= Values.size() && Values.size() > 0) // return the maximum value - return Values[Values.size() - 1].repeated; + return Values[Values.size() - 1].Repeat(); else // return a blank coordinate (0,0) return Fraction(1,1); @@ -248,13 +269,13 @@ float Keyframe::GetDelta(int index) // Is index a valid point? if (index >= 0 && index < Values.size()) // Return value - return Values[index].delta; + return Values[index].Delta(); else if (index < 0 && Values.size() > 0) // Return the minimum value - return Values[0].delta; + return Values[0].Delta(); else if (index >= Values.size() && Values.size() > 0) // return the maximum value - return Values[Values.size() - 1].delta; + return Values[Values.size() - 1].Delta(); else // return a blank coordinate (0,0) return 0.0; @@ -352,7 +373,7 @@ void Keyframe::PrintValues() { for (vector::iterator it = Values.begin() + 1; it != Values.end(); it++) { Coordinate c = *it; - cout << int(round(c.X)) << "\t" << c.Y << "\t" << c.increasing << "\t" << c.repeated.num << "\t" << c.repeated.den << "\t" << c.delta << endl; + cout << int(round(c.X)) << "\t" << c.Y << "\t" << c.IsIncreasing() << "\t" << c.Repeat().num << "\t" << c.Repeat().den << "\t" << c.Delta() << endl; } } @@ -423,7 +444,7 @@ void Keyframe::Process() { } // Set direction - (*it).increasing = increasing; + (*it).IsIncreasing(increasing); // Detect repeated Y value if (current_value == last_value) @@ -445,11 +466,10 @@ void Keyframe::Process() { } // Set repeat fraction - (*it).repeated.num = repeat_count; - (*it).repeated.den = repeat_count + additional_repeats; + (*it).Repeat(Fraction(repeat_count, repeat_count + additional_repeats)); // Set delta (i.e. different from previous unique Y value) - (*it).delta = current_value - last_value; + (*it).Delta(current_value - last_value); // track the last value last_value = current_value; diff --git a/src/Player.cpp b/src/Player.cpp index 6c1a0c8e..99c4f87e 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -1,3 +1,30 @@ +/** + * @file + * @brief Source file for Player class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #include "../include/Player.h" using namespace openshot; diff --git a/src/Point.cpp b/src/Point.cpp index 6b6a59cc..9132e962 100644 --- a/src/Point.cpp +++ b/src/Point.cpp @@ -1,7 +1,28 @@ /** * @file - * @brief Source code for the Point class - * @author Copyright (c) 2008-2013 OpenShot Studios, LLC + * @brief Source file for Point class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . */ #include "../include/Point.h" diff --git a/src/ReaderBase.cpp b/src/ReaderBase.cpp index 0caa2d61..fec88334 100644 --- a/src/ReaderBase.cpp +++ b/src/ReaderBase.cpp @@ -1,3 +1,30 @@ +/** + * @file + * @brief Source file for ReaderBase class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #include "../include/ReaderBase.h" using namespace openshot; diff --git a/src/TextReader.cpp b/src/TextReader.cpp index ae2c39a0..94b47c9a 100644 --- a/src/TextReader.cpp +++ b/src/TextReader.cpp @@ -1,3 +1,30 @@ +/** + * @file + * @brief Source file for TextReader class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #include "../include/TextReader.h" using namespace openshot; diff --git a/src/Timeline.cpp b/src/Timeline.cpp index 83676aa2..acbac92b 100644 --- a/src/Timeline.cpp +++ b/src/Timeline.cpp @@ -1,3 +1,30 @@ +/** + * @file + * @brief Source file for Timeline class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #include "../include/Timeline.h" using namespace openshot; diff --git a/src/WriterBase.cpp b/src/WriterBase.cpp index 2a56af8b..e1feaf2a 100644 --- a/src/WriterBase.cpp +++ b/src/WriterBase.cpp @@ -1,3 +1,30 @@ +/** + * @file + * @brief Source file for WriterBase class + * @author Jonathan Thomas + * + * @section LICENSE + * + * Copyright (c) 2008-2013 OpenShot Studios, LLC + * (http://www.openshotstudios.com). This file is part of + * OpenShot Library (http://www.openshot.org), an open-source project + * dedicated to delivering high quality video editing and animation solutions + * to the world. + * + * OpenShot Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenShot Library 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 OpenShot Library. If not, see . + */ + #include "../include/WriterBase.h" using namespace openshot; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 72a3fb26..ec2139a6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,7 +35,7 @@ include_directories(${SDL_INCLUDE_DIR}) ################# QT4 ################### # Find QT4 libraries -SET(QT_QMAKE_EXECUTABLE '/usr/bin/qmake-qt4') # DEBUB, WORK-AROUND: Force the use of QT4 (when multiple versions are installed) +#SET(QT_QMAKE_EXECUTABLE '/usr/bin/qmake-qt4') # DEBUB, WORK-AROUND: Force the use of QT4 (when multiple versions are installed) FIND_PACKAGE(Qt4 REQUIRED) # Include Qt headers (needed for compile)