Add toString() method to selected enums

This commit is contained in:
Tamius Han 2020-12-16 00:18:23 +01:00
parent 29dff35bb4
commit 3f8ea683ef
2 changed files with 36 additions and 2 deletions

View File

@ -5,7 +5,27 @@ var Stretch = Object.freeze({
Conditional: 3,
Fixed: 4,
FixedSource: 5,
Default: -1
Default: -1,
toString: (stretch) => {
switch (stretch) {
case 0:
return 'NoStretch';
case 1:
return 'Basic';
case 2:
return 'Hybrid';
case 3:
return 'Conditional';
case 4:
return 'Fixed';
case 5:
return 'FixedSource';
case -1:
return 'Default';
default:
return 'INVALID STRETCH VALUE';
}
}
});
export default Stretch;

View File

@ -2,7 +2,21 @@ var VideoAlignment = Object.freeze({
Left: 0,
Center: 1,
Right: 2,
Default: -1
Default: -1,
toString: (alignment) => {
switch (alignment) {
case 0:
return 'Left';
case 1:
return 'Center';
case 2:
return 'Right';
case -1:
return 'Default';
default:
return 'ILLEGAL VIDEO ALIGNMENT';
}
}
});
export default VideoAlignment;