rodionovd / HSCore.framework

HoneySound Core framework
1 stars 0 forks source link

API v1 suggestions #1

Closed rodionovd closed 9 years ago

rodionovd commented 9 years ago

Let's choose the API for the framework.

My version is:

1. Single bundle

- (void)setVolumeLevel: (CGFloat)level forBundle: (NSString *)bundleID callback: (xxx)callback;

// a shortcut for [-setVolumeLevel: 0.0f forBundle: bundleID callback: nil]
- (void)muteBundle: (NSString *)bundleID;

// remove injection
- (void)restoreVolumeLevelForBundle: (NSString *)bundleID;

// current volume level
// @iCyberon >> The applications that are not injected should return 100% or null;
- (CGFloat)getVolumeLevelForBundle: (NSString *)bundleID;

2. Multiple bundles


// params: {@"bundleID1" : @(0.3f), @"bundleID2" : @(0.7f), ...};
- (void)setVolumeLevelsForBundles: (NSDictionary *)params callback: (yyy)callback;

// remove all the injection (useful when user quit HoneySound)
- (void)restoreVolumeLevelForBundles: (NSString *)bundleID:
// or — not sure about this
- (void)revertInjection;

// current volume level
// @iCyberon >> The applications that are not injected should return 100% or null;
- (void)getVolumeLeveslForBundles:  (NSString *)bundleID callback: (zzz)callback;

What do you think, @iCyberon? Have I missed anything?

iCyberon commented 9 years ago

API looks good :+1:

Regarding revertInjection, we definitely need that one. We'll have some cases when user wants to "clear" all the injections at once.

I think we need to implement unmute too:

- (void)unmuteBundle: (NSString *)bundleID;

Useful when user wants to temporarily mute a specific app and preserve it's volume level.

And it would be great be able to increase/decrease by X% (Let's say 10%). This will give us an opportunity to have a shortcut that'll control the volume level of the running app. Of course we can implement this in the UI wrapper.

// Increase volume level by 10%
- (void)increaseVolumeLevelForBundle: (NSString *)bundleID;

// Decrease volume level by 10%
- (void)decreaseVolumeLevelForBundle: (NSString *)bundleID;
rodionovd commented 9 years ago

OK, get it. Now it's time to write some code :)

I'm going to push all changes to develop branch (let's leave master for a stable v1.0), so check it out from time to time :shipit: