sundayliu / iphoneebooks

Automatically exported from code.google.com/p/iphoneebooks
GNU General Public License v2.0
0 stars 0 forks source link

Feature request: volume buttons for page turning #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This would be the ideal way to turn pages on my opinion. Not sure of it is 
possible but I didnt 
see of on your issues list or I'm your list of features that you would never 
implement. 

Original issue reported on code.google.com by sca...@gmail.com on 5 Nov 2007 at 12:28

GoogleCodeExporter commented 9 years ago
I agree, this would help the usability quite a bit.

Original comment by emoll...@gmail.com on 14 Nov 2007 at 4:18

GoogleCodeExporter commented 9 years ago
From my experience of reading ebook in Palm machine, I think the volume buttons 
of 
iphone is too "hard" for frequent operation (page turning).Also, i am afraid 
too 
much using will make it to die earlier. Just my own opinion.

Original comment by penny...@gmail.com on 17 Jan 2008 at 2:04

GoogleCodeExporter commented 9 years ago
I have tried to do it but haven't found a way to receive events in the app when 
the
volume buttons are pushed

Original comment by benoitce...@gmail.com on 20 Jan 2008 at 3:57

GoogleCodeExporter commented 9 years ago

Original comment by pendorbo...@gmail.com on 17 Feb 2008 at 6:16

GoogleCodeExporter commented 9 years ago

Original comment by pendorbo...@gmail.com on 23 Feb 2008 at 7:02

GoogleCodeExporter commented 9 years ago
The following code might help, although it still shows speaker icon.

--------------------- in EBookView.h
#import <Celestial/AVSystemController.h>
@interface EBookView : UITextView {
...
  AVSystemController *avs;
  float defaultVolume;
...
}

--------------------- in EBookView.m
#import <Celestial/AVSystemController.h>
...

@implementation EBookView
- (id)initWithFrame:(struct CGRect)rect {
...
avs = [AVSystemController sharedAVSystemController];
[[NSNotificationCenter defaultCenter] addObserver: self
selector:@selector(volumeChanged:)
name:@"AVSystemController_SystemVolumeDidChangeNotification" object: avs];
NSString *name;
[avs getActiveCategoryVolume:&defaultVolume andName:&name];
...

- (void)volumeChanged:(NSNotification *)notification
{
// INSERT HERE CHECK FOR GLOBAL PREFERENCE "USE_VOLUME_CONTROLS_TO_TURN_PAGES"
 float volume;
 NSString *audioDeviceName;
 [avs getActiveCategoryVolume: &volume andName: &audioDeviceName];
 NSLog(@"Volume changed: %f",volume);
 if (volume != defaultVolume) {
   if (volume > defaultVolume) {
    [self pageUpWithTopBar:NO bottomBar:![defaults toolbar]];
   } else {
    [self pageDownWithTopBar:![defaults navbar] bottomBar:NO];
   }
   [avs setActiveCategoryVolumeTo: defaultVolume];
 }
}

Original comment by sergemak...@gmail.com on 14 Apr 2008 at 3:16

GoogleCodeExporter commented 9 years ago
None of that API is public in the SDK.  We're not going to add code now that 
would
have to be yanked in a few months.

Original comment by pendorbo...@gmail.com on 4 May 2008 at 10:03

GoogleCodeExporter commented 9 years ago
oops,
I have actually added it. In the svn version.
We may not be able to redo it in the sdk but I think it will be nice.

Original comment by benoitce...@gmail.com on 30 May 2008 at 3:19