Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Modules are re-entrant (concurrency) #257

Merged
merged 89 commits into from Apr 1, 2020
Merged

Flutter Modules are re-entrant (concurrency) #257

merged 89 commits into from Apr 1, 2020

Conversation

Larpoux
Copy link
Collaborator

@Larpoux Larpoux commented Mar 29, 2020

This is a major re-design of flutter_sound architecture.
flutter_sound module is now split into :

  • FlautoRecorder
  • FlautoPlayer

All modules are re-entrant. It is possible to start several FlutterPlayer and several FlutterRecorder at the same time.

Complete backward compatibility is provided by two deprecated modules :

  • FlutterSound.dart
  • Flauto.dart

Larpoux and others added 30 commits January 21, 2020 17:53
…roller was null

- StartPlayerFromBuffer tested _audioState too late
- Do not throw an exception when calling stopPlayer and the Player is already stopped
…IS_STOPPED". Just stop the player silently
}

void setCallback() {
channel = const MethodChannel('xyz.canardoux.track_player');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any changes in this method channel?

@hyochan
Copy link
Collaborator

hyochan commented Apr 1, 2020

This is a major re-design of flutter_sound architecture.
flutter_sound module is now split into :

  • FlautoRecorder
  • FlautoPlayer

All modules are re-entrant. It is possible to start several FlutterPlayer and several FlutterRecorder at the same time.

Complete backward compatibility is provided by two deprecated modules :

  • FlutterSound.dart
  • Flauto.dart

@Larpoux I am currently suffering from file changes you've mentioned. I can't see any FlutterPlayer and FlutterRecorder in this updates. Rather it is FlautoPlayer and FlautoRecorder. I don't care about current naming but I am wondering since it sounds like you wanna change them.

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

I changed the name. Now the two modules are :

  • FlutterSoundRecorder.dart
  • FlutterSoundPlayer.dart

But I did not changed the names of the module in Java and Objective-C. I can do that, now, if you want.
The name of the MethodChannel is not good. I am going to change that, now :

  • com.dooboolab.flutter_sound_track_player
  • com.dooboolab.flutter_sound_recorder
  • com.dooboolab.flutter_sound_player

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

Now, there is 3 channels :

  • One for the Player
  • One for the Recorder
  • One for the TrackPlayer (flauto extension)

If the App uses several FlutterSoundPlayer, there is several instances of Android Andio Player and several AVAudioPlayer. All those instances are multiplexed on the channel com.dooboolab.flutter_sound_player

If the App uses several FlutterSoundRecorder, there is several instances of Android Audio Recorder and several AVAudioRecorder. All those instances are multiplexed on the channel com.dooboolab.flutter_sound_recorder

…er_sound_recorder and com.dooboolab.flutter_sound_track_player
@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

OK Hyo, the 3 channel names are now correct

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

Do you want I rename the Java modules and Objective C modules ?

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

I really think that multiplexing all the flutter_sound instances on the 3 channels is good design.

@hyochan
Copy link
Collaborator

hyochan commented Apr 1, 2020

image

I am still seeing FlautoPlayer and not FlutterPlayer tough.

@hyochan
Copy link
Collaborator

hyochan commented Apr 1, 2020

@Larpoux Oh sorry, you've pushed a commit just now~! I'll check that out!

@hyochan
Copy link
Collaborator

hyochan commented Apr 1, 2020

Ok! I've just checked this out and the file names and classes are not changed. Is this what you want?

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

Yes, this is what I said.
I will change those name this after-noon. This sill be cleaner.

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

Better is Java Modules and ios modules have same name than dart modules

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

I will do that after lunch

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

Hyo, I fixed a little bug when we try 'Player seek` on iOS.

Seek seems not working with TrackPlayer on Android.
But it works fine with 'FlutterSoundPlayer', and there is no crash. It just does not work with flauto.

I think that's no problem for a current release.

@hyochan
Copy link
Collaborator

hyochan commented Apr 1, 2020

Hyo, I fixed a little bug when we try 'Player seek` on iOS.

Seek seems not working with TrackPlayer on Android.
But it works fine with 'FlutterSoundPlayer', and there is no crash. It just does not work with flauto.

I think that's no problem for a current release.

I am on fixing seeking in android. Let me do this part~!

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

👍 . Great 😸

@Larpoux
Copy link
Collaborator Author

Larpoux commented Apr 1, 2020

Hyo, I renamed the ios modules and Java modules.
I think this is good now.
I am going for my lunch .

@hyochan hyochan mentioned this pull request Apr 1, 2020
@hyochan
Copy link
Collaborator

hyochan commented Apr 1, 2020

Closes for #261

@hyochan hyochan closed this Apr 1, 2020
@hyochan hyochan reopened this Apr 1, 2020
Copy link
Collaborator

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let me merge this and continue working on #261

@hyochan hyochan merged commit 34c678d into Canardoux:master Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants