Skip to content

Commit d5fb40d

Browse files
author
Clement Champetier
committed
Option: rename enum OptionType to EOptionBaseType
Also rename enum values.
1 parent a856992 commit d5fb40d

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

app/optionChecker/optionChecker.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ void displayOptions( avtranscoder::OptionLoader::OptionArray& options )
2020

2121
// get default value
2222

23-
if( option.getType() == avtranscoder::TypeInt )
23+
if( option.getType() == avtranscoder::eOptionBaseTypeInt )
2424
{
2525
std::cout << "DefaultValue: " << option.getDefaultValueInt() << std::endl;
2626
}
27-
else if( option.getType() == avtranscoder::TypeBool )
27+
else if( option.getType() == avtranscoder::eOptionBaseTypeBool )
2828
{
2929
std::cout << "DefaultValue: " << option.getDefaultValueBool() << std::endl;
3030
}
31-
else if( option.getType() == avtranscoder::TypeDouble )
31+
else if( option.getType() == avtranscoder::eOptionBaseTypeDouble )
3232
{
3333
std::cout << "DefaultValue: " << option.getDefaultValueDouble() << std::endl;
3434
}
35-
else if( option.getType() == avtranscoder::TypeRatio )
35+
else if( option.getType() == avtranscoder::eOptionBaseTypeRatio )
3636
{
3737
std::cout << "DefaultValue: " << option.getDefaultValueRatio().first << ", " << option.getDefaultValueRatio().second << std::endl;
3838
}
39-
else if( option.getType() == avtranscoder::TypeString )
39+
else if( option.getType() == avtranscoder::eOptionBaseTypeString )
4040
{
4141
std::cout << "DefaultValue: " << option.getDefaultValueString() << std::endl;
4242
}
43-
else if( option.getType() == avtranscoder::TypeChoice )
43+
else if( option.getType() == avtranscoder::eOptionBaseTypeChoice )
4444
{
4545
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
4646
std::cout << "Default choice index: " << option.getDefaultChildIndex() << std::endl;
@@ -49,7 +49,7 @@ void displayOptions( avtranscoder::OptionLoader::OptionArray& options )
4949
option.getChild( i ).getName() << " // " <<
5050
option.getChild( i ).getHelp() << std::endl;
5151
}
52-
else if( option.getType() == avtranscoder::TypeGroup )
52+
else if( option.getType() == avtranscoder::eOptionBaseTypeGroup )
5353
{
5454
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
5555
for(size_t i = 0; i < option.getNbChilds(); ++i )

src/AvTranscoder/option/Option.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,49 @@ Option::Option( const AVOption& avOption )
1111
_type = getTypeFromAVOption( getUnit(), _avOption.type );
1212
}
1313

14-
OptionType Option::getTypeFromAVOption( const std::string& unit, const AVOptionType avType )
14+
EOptionBaseType Option::getTypeFromAVOption( const std::string& unit, const AVOptionType avType )
1515
{
1616
if( ! unit.empty() && avType == AV_OPT_TYPE_FLAGS )
17-
return TypeGroup;
17+
return eOptionBaseTypeGroup;
1818
else if( ! unit.empty() && ( avType == AV_OPT_TYPE_INT || avType == AV_OPT_TYPE_INT64 ) )
19-
return TypeChoice;
19+
return eOptionBaseTypeChoice;
2020
else if( ! unit.empty() && avType == AV_OPT_TYPE_CONST )
21-
return TypeChild;
21+
return eOptionBaseTypeChild;
2222

2323
switch( avType )
2424
{
2525
case AV_OPT_TYPE_FLAGS:
2626
{
27-
return TypeBool;
27+
return eOptionBaseTypeBool;
2828
}
2929
case AV_OPT_TYPE_INT:
3030
case AV_OPT_TYPE_INT64:
3131
{
32-
return TypeInt;
32+
return eOptionBaseTypeInt;
3333
}
3434
case AV_OPT_TYPE_DOUBLE:
3535
case AV_OPT_TYPE_FLOAT:
3636
{
37-
return TypeDouble;
37+
return eOptionBaseTypeDouble;
3838
}
3939
case AV_OPT_TYPE_STRING:
4040
case AV_OPT_TYPE_BINARY:
4141
{
42-
return TypeString;
42+
return eOptionBaseTypeString;
4343
}
4444
case AV_OPT_TYPE_RATIONAL:
4545
{
46-
return TypeRatio;
46+
return eOptionBaseTypeRatio;
4747
}
4848
default:
4949
{
50-
return TypeUnknown;
50+
return eOptionBaseTypeUnknown;
5151
}
5252
}
53-
return TypeUnknown;
53+
return eOptionBaseTypeUnknown;
5454
}
5555

56-
OptionType Option::getType() const
56+
EOptionBaseType Option::getType() const
5757
{
5858
return _type;
5959
}

src/AvTranscoder/option/Option.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ extern "C" {
1515
namespace avtranscoder
1616
{
1717

18-
enum OptionType
18+
enum EOptionBaseType
1919
{
20-
TypeBool,
21-
TypeInt,
22-
TypeDouble,
23-
TypeString,
24-
TypeRatio,
25-
TypeChoice,
26-
TypeGroup,
27-
TypeChild, // Option which belongs to Choice or Group
28-
TypeUnknown
20+
eOptionBaseTypeBool,
21+
eOptionBaseTypeInt,
22+
eOptionBaseTypeDouble,
23+
eOptionBaseTypeString,
24+
eOptionBaseTypeRatio,
25+
eOptionBaseTypeChoice,
26+
eOptionBaseTypeGroup,
27+
eOptionBaseTypeChild, // Option which belongs to Choice or Group
28+
eOptionBaseTypeUnknown
2929
};
3030

3131
/**
@@ -39,7 +39,7 @@ class Option
3939
Option( const AVOption& avOption );
4040
~Option() {}
4141

42-
OptionType getType() const;
42+
EOptionBaseType getType() const;
4343

4444
std::string getName() const { return std::string( _avOption.name ? _avOption.name : "" ); }
4545
std::string getHelp() const { return std::string( _avOption.help ? _avOption.help : "" ); }
@@ -74,11 +74,11 @@ class Option
7474
void appendChild( const Option& child );
7575

7676
private:
77-
OptionType getTypeFromAVOption( const std::string& unit, const AVOptionType avType );
77+
EOptionBaseType getTypeFromAVOption( const std::string& unit, const AVOptionType avType );
7878

7979
private:
8080
AVOption _avOption;
81-
OptionType _type;
81+
EOptionBaseType _type;
8282

8383
/**
8484
* If the option corresponds to a Choice or a Group, it can contain childs,

src/AvTranscoder/option/OptionLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ OptionLoader::OptionArray OptionLoader::loadOptions( void* av_class, int req_fla
244244

245245
Option option( *avOption );
246246

247-
if( option.getType() == TypeChild )
247+
if( option.getType() == eOptionBaseTypeChild )
248248
{
249249
childOptions.push_back( option );
250250
}
@@ -273,7 +273,7 @@ OptionLoader::OptionArray OptionLoader::loadOptions( void* av_class, int req_fla
273273
parentOption.appendChild( *itOption );
274274

275275
// child of a Choice
276-
if( parentOption.getType() == TypeChoice )
276+
if( parentOption.getType() == eOptionBaseTypeChoice )
277277
{
278278
if( itOption->getDefaultValueInt() == parentOption.getDefaultValueInt() )
279279
parentOption.setDefaultChildIndex( parentOption.getNbChilds() - 1 );

0 commit comments

Comments
 (0)