Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: prevent from confusing and conflicting class names (#1465)
# Description As some of the classes introduced in #1352 are quite generic and could conflict with other packages, we should rename them to be more specific to the package: - Refactor `GlobalEvent` to `GlobalAudioEvent` - Refactor `PlayerEvent` to `AudioEvent` - Refactor `Logger` to `AudioLogger` - Refactor `LogLevel` to `AudioLogLevel` PlayerEvent was renamed to have the same scheme as `GlobalAudioEvent` and so that it is more applicable to Audio and not to all players in general (e.g. media or video player). ## Breaking Change This is a breaking change regarding the current master channel, but not the published versions. **audioplayers** | Before | After | |---|---| | `GlobalEvent` | `GlobalAudioEvent` | | `PlayerEvent` | `AudioEvent` | | `Logger` | `AudioLogger` | | `LogLevel` | `AudioLogLevel` | **audioplayers_platform_interface** | Before | After | |---|---| | `GlobalEvent` | `GlobalAudioEvent` | | `PlayerEvent` | `AudioEvent` | ## Related Issues #1352
- Loading branch information
Showing
25 changed files
with
190 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
export 'package:audioplayers_platform_interface/src/api/audio_context.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/audio_context_config.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/global_event.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/player_event.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/audio_event.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/global_audio_event.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/player_mode.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/player_state.dart'; | ||
export 'package:audioplayers_platform_interface/src/api/release_mode.dart'; | ||
|
||
export 'src/audio_cache.dart'; | ||
export 'src/audio_log_level.dart'; | ||
export 'src/audio_logger.dart'; | ||
export 'src/audio_pool.dart'; | ||
export 'src/audioplayer.dart'; | ||
export 'src/global_audio_scope.dart'; | ||
export 'src/log_level.dart'; | ||
export 'src/logger.dart'; | ||
export 'src/source.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
enum AudioLogLevel implements Comparable<AudioLogLevel> { | ||
none(0), | ||
error(1), | ||
info(2); | ||
|
||
const AudioLogLevel(this.level); | ||
|
||
factory AudioLogLevel.fromInt(int level) { | ||
return values.firstWhere((e) => e.level == level); | ||
} | ||
|
||
final int level; | ||
|
||
@override | ||
int compareTo(AudioLogLevel other) => level - other.level; | ||
} |
8 changes: 4 additions & 4 deletions
8
packages/audioplayers/lib/src/logger.dart → ...es/audioplayers/lib/src/audio_logger.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.