Skip to content

Commit 33cfb8b

Browse files
committed
Clip/DummyReader: std:: prefixes
1 parent 38e82e7 commit 33cfb8b

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

include/Clip.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
#include "ReaderBase.h"
5252
#include "JuceHeader.h"
5353

54-
using namespace std;
55-
using namespace openshot;
56-
5754
namespace openshot {
5855

5956
/// Comparison method for sorting effect pointers (by Position, Layer, and Order). Effects are sorted
@@ -107,7 +104,7 @@ namespace openshot {
107104

108105
private:
109106
bool waveform; ///< Should a waveform be used instead of the clip's image
110-
list<EffectBase*> effects; ///<List of clips on this timeline
107+
std::list<EffectBase*> effects; ///<List of clips on this timeline
111108

112109
// Audio resampler (if time mapping)
113110
AudioResampler *resampler;
@@ -127,7 +124,7 @@ namespace openshot {
127124
std::shared_ptr<Frame> apply_effects(std::shared_ptr<Frame> frame);
128125

129126
/// Get file extension
130-
string get_file_extension(string path);
127+
std::string get_file_extension(std::string path);
131128

132129
/// Get a frame object or create a blank one
133130
std::shared_ptr<Frame> GetOrCreateFrame(int64_t number);
@@ -159,7 +156,7 @@ namespace openshot {
159156

160157
/// @brief Constructor with filepath (reader is automatically created... by guessing file extensions)
161158
/// @param path The path of a reader (video file, image file, etc...). The correct reader will be used automatically.
162-
Clip(string path);
159+
Clip(std::string path);
163160

164161
/// @brief Constructor with reader
165162
/// @param new_reader The reader to be used by this clip
@@ -176,7 +173,7 @@ namespace openshot {
176173
void Close();
177174

178175
/// Return the list of effects on the timeline
179-
list<EffectBase*> Effects() { return effects; };
176+
std::list<EffectBase*> Effects() { return effects; };
180177

181178
/// @brief Get an openshot::Frame object for a specific frame number of this timeline.
182179
///
@@ -199,14 +196,14 @@ namespace openshot {
199196
void End(float value) { end = value; } ///< Set end position (in seconds) of clip (trim end of video)
200197

201198
/// Get and Set JSON methods
202-
string Json(); ///< Generate JSON string of this object
203-
void SetJson(string value); ///< Load JSON string into this object
199+
std::string Json(); ///< Generate JSON string of this object
200+
void SetJson(std::string value); ///< Load JSON string into this object
204201
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
205202
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
206203

207204
/// Get all properties for a specific frame (perfect for a UI to display the current state
208205
/// of all properties at any time)
209-
string PropertiesJSON(int64_t requested_frame);
206+
std::string PropertiesJSON(int64_t requested_frame);
210207

211208
/// @brief Remove an effect from the clip
212209
/// @param effect Remove an effect from the clip.

include/DummyReader.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#include "Exceptions.h"
4444
#include "Fraction.h"
4545

46-
using namespace std;
47-
4846
namespace openshot
4947
{
5048
/**
@@ -86,11 +84,11 @@ namespace openshot
8684
bool IsOpen() { return is_open; };
8785

8886
/// Return the type name of the class
89-
string Name() { return "DummyReader"; };
87+
std::string Name() { return "DummyReader"; };
9088

9189
/// Get and Set JSON methods
92-
string Json(); ///< Generate JSON string of this object
93-
void SetJson(string value); ///< Load JSON string into this object
90+
std::string Json(); ///< Generate JSON string of this object
91+
void SetJson(std::string value); ///< Load JSON string into this object
9492
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
9593
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
9694

src/Clip.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ Clip::Clip(ReaderBase* new_reader) : resampler(NULL), audio_cache(NULL), reader(
152152
}
153153

154154
// Constructor with filepath
155-
Clip::Clip(string path) : resampler(NULL), audio_cache(NULL), reader(NULL), allocated_reader(NULL)
155+
Clip::Clip(std::string path) : resampler(NULL), audio_cache(NULL), reader(NULL), allocated_reader(NULL)
156156
{
157157
// Init all default settings
158158
init_settings();
159159

160160
// Get file extension (and convert to lower case)
161-
string ext = get_file_extension(path);
161+
std::string ext = get_file_extension(path);
162162
transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
163163

164164
// Determine if common video formats
@@ -354,7 +354,7 @@ std::shared_ptr<Frame> Clip::GetFrame(int64_t requested_frame)
354354
}
355355

356356
// Get file extension
357-
string Clip::get_file_extension(string path)
357+
std::string Clip::get_file_extension(std::string path)
358358
{
359359
// return last part of path
360360
return path.substr(path.find_last_of(".") + 1);
@@ -645,14 +645,14 @@ std::shared_ptr<Frame> Clip::GetOrCreateFrame(int64_t number)
645645
}
646646

647647
// Generate JSON string of this object
648-
string Clip::Json() {
648+
std::string Clip::Json() {
649649

650650
// Return formatted string
651651
return JsonValue().toStyledString();
652652
}
653653

654654
// Get all properties for a specific frame
655-
string Clip::PropertiesJSON(int64_t requested_frame) {
655+
std::string Clip::PropertiesJSON(int64_t requested_frame) {
656656

657657
// Generate JSON properties list
658658
Json::Value root;
@@ -782,7 +782,7 @@ Json::Value Clip::JsonValue() {
782782
root["effects"] = Json::Value(Json::arrayValue);
783783

784784
// loop through effects
785-
list<EffectBase*>::iterator effect_itr;
785+
std::list<EffectBase*>::iterator effect_itr;
786786
for (effect_itr=effects.begin(); effect_itr != effects.end(); ++effect_itr)
787787
{
788788
// Get clip object from the iterator
@@ -798,14 +798,14 @@ Json::Value Clip::JsonValue() {
798798
}
799799

800800
// Load JSON string into this object
801-
void Clip::SetJson(string value) {
801+
void Clip::SetJson(std::string value) {
802802

803803
// Parse JSON string into JSON objects
804804
Json::Value root;
805805
Json::CharReaderBuilder rbuilder;
806806
Json::CharReader* reader(rbuilder.newCharReader());
807807

808-
string errors;
808+
std::string errors;
809809
bool success = reader->parse( value.c_str(),
810810
value.c_str() + value.size(), &root, &errors );
811811
delete reader;
@@ -943,7 +943,7 @@ void Clip::SetJsonValue(Json::Value root) {
943943
}
944944

945945
// Create new reader (and load properties)
946-
string type = root["reader"]["type"].asString();
946+
std::string type = root["reader"]["type"].asString();
947947

948948
if (type == "FFmpegReader") {
949949

@@ -1025,7 +1025,7 @@ void Clip::RemoveEffect(EffectBase* effect)
10251025
std::shared_ptr<Frame> Clip::apply_effects(std::shared_ptr<Frame> frame)
10261026
{
10271027
// Find Effects at this position and layer
1028-
list<EffectBase*>::iterator effect_itr;
1028+
std::list<EffectBase*>::iterator effect_itr;
10291029
for (effect_itr=effects.begin(); effect_itr != effects.end(); ++effect_itr)
10301030
{
10311031
// Get clip object from the iterator

src/DummyReader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ std::shared_ptr<Frame> DummyReader::GetFrame(int64_t requested_frame)
124124
}
125125

126126
// Generate JSON string of this object
127-
string DummyReader::Json() {
127+
std::string DummyReader::Json() {
128128

129129
// Return formatted string
130130
return JsonValue().toStyledString();
@@ -142,14 +142,14 @@ Json::Value DummyReader::JsonValue() {
142142
}
143143

144144
// Load JSON string into this object
145-
void DummyReader::SetJson(string value) {
145+
void DummyReader::SetJson(std::string value) {
146146

147147
// Parse JSON string into JSON objects
148148
Json::Value root;
149149
Json::CharReaderBuilder rbuilder;
150150
Json::CharReader* reader(rbuilder.newCharReader());
151151

152-
string errors;
152+
std::string errors;
153153
bool success = reader->parse( value.c_str(),
154154
value.c_str() + value.size(), &root, &errors );
155155
delete reader;

0 commit comments

Comments
 (0)