Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2002 Björn Stenberg
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
- /* welcome to the example rockbox plugin */
- /* mandatory include for all plugins */
- #include "plugin.h"
- #define AB_OFF (BUTTON_MENU | BUTTON_SELECT)
- #define AB_ROTATE_CCW BUTTON_SCROLL_BACK
- #define AB_UP (BUTTON_MENU | BUTTON_REL)
- #define AB_ROTATE_CW BUTTON_SCROLL_FWD
- #define AB_LEFT BUTTON_LEFT
- #define AB_RIGHT BUTTON_RIGHT
- #define AB_DOWN BUTTON_PLAY
- #define AB_BUTTON BUTTON_SELECT
- //#define AB_RESTART (BUTTON_SELECT | BUTTON_PLAY)
- //#define AB_DROP (BUTTON_SELECT | BUTTON_REL)
- //static int SetChannels(void);
- static void callback(const void** start, size_t* size);
- static void callback(const void** start, size_t* size)
- {
- (void)start; /* unused parameter, avoid warning */
- *size = 0; /* end of data */
- //sound_active = false;
- //rb->led(0);
- }
- static short *cBArr[256];
- //static short *cBArr_R[256];
- /*
- static int SetChannels(void)
- {
- q=0;
- newbuttonstate = rb->button_status();
- released = ~newbuttonstate & oldbuttonstate;
- pressed = newbuttonstate & ~oldbuttonstate;
- oldbuttonstate = newbuttonstate;
- //
- //rb->lcd_putsxyf (0, 0, "%d", newbuttonstate);
- //sprintf(buf, "%d", newbuttonstate);
- //rb->splash(HZ*2, buf);
- rb->lcd_putsxyf (0, 0, "%d", newbuttonstate);
- rb->lcd_update();
- for(q=0; q<256; q+=2)
- {
- cBArr[q]=
- }
- rb->pcm_play_data(NULL, NULL, tick_buf, sizeof(tick_buf));
- if((pressed & (BUTTON_MENU)) && pressed & (BUTTON_SELECT))
- {
- return 0;
- }
- return 1;
- }
- */
- /* this is the plugin entry point */
- enum plugin_status plugin_start(const void* parameter)
- {
- /* if you don't use the parameter, you can do like
- this to avoid the compiler warning about it */
- (void)parameter;
- bool quit = false;
- unsigned int newbuttonstate = 0;
- unsigned int released = 0;
- unsigned int pressed = 0;
- unsigned int oldbuttonstate = 0;
- unsigned int end=0;
- unsigned int cycletime=300;
- int f_width, f_height;
- #if LCD_DEPTH > 1
- rb->lcd_set_backdrop(NULL);
- rb->lcd_set_background(LCD_BLACK);
- rb->lcd_set_foreground(LCD_WHITE);
- #endif
- rb->lcd_setfont(FONT_SYSFIXED);
- rb->lcd_getstringsize("100000000", &f_width, &f_height);
- rb->lcd_clear_display();
- rb->lcd_set_drawmode(DRMODE_SOLID);
- while(!quit)
- {
- newbuttonstate = rb->button_status();
- released = ~newbuttonstate & oldbuttonstate;
- pressed = newbuttonstate & ~oldbuttonstate;
- oldbuttonstate = newbuttonstate;
- rb->lcd_clear_display();
- rb->lcd_putsxyf (0, 0, "%d", newbuttonstate);
- rb->lcd_update();
- if(pressed & BUTTON_MENU && pressed & BUTTON_SELECT)
- {
- quit=true;
- }
- rb->yield();
- }
- return PLUGIN_OK;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement