summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/pluginlib_exit.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-03-01 12:31:03 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-03-01 12:31:03 +0000
commit485ff795843597483264b1c9ce1a29a154aa6679 (patch)
tree63d99c6a73c55f9fb2159633264355209e186b38 /apps/plugins/lib/pluginlib_exit.h
parent735ea2fd1f746bed999e488eee129ff5b3af059a (diff)
downloadrockbox-485ff795843597483264b1c9ce1a29a154aa6679.zip
rockbox-485ff795843597483264b1c9ce1a29a154aa6679.tar.gz
rockbox-485ff795843597483264b1c9ce1a29a154aa6679.tar.bz2
rockbox-485ff795843597483264b1c9ce1a29a154aa6679.tar.xz
Add an ability to set a setting to a specific value with a touchscreen action.
example: %T(0,0,20,12, setting_set, repeat, off) That will set the repeat mode to "off" when it is pressed. "setting_set" is the action name "repeat" is the name of the setting in the config files "off" is the value to set it to (same values as the legal values in the config files) Not all settings are supported, outright unsupported settings will fail to parse. Some settings might not work too well if they don't apply instantly (Any that work well int he quickscreen should work well here) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29483 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
32 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
/*
 * iFish -- An iRiver iHP jukebox database creation tool
 *
 * Copyright (c) 2004 Richard "Shred" Körber
 *   http://www.shredzone.net/go/ifish
 *
 *-----------------------------------------------------------------------
 * ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is IFISH.
 *
 * The Initial Developer of the Original Code is
 * Richard "Shred" Körber.
 * Portions created by the Initial Developer are Copyright (C) 2004
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK *****
 */

package net.shredzone.ifish.ltr;

import java.io.*;
import java.util.regex.*;

/**
 * Decodes an MP3 file with ID3v2 tag. The file is compliant to the
 * specifications found at <a href="http://www.id3.org">www.id3.org</a>,
 * V2.4.0 and V2.3.0. ID3 V2.2.0 is handled in a separate tag handler.
 * Anyhow it has certain limitations regarding tag frames which could
 * not be used or entirely used to iFish, e.g. multiple genres.
 *
 * @author    Richard Körber &lt;dev@shredzone.de&gt;
 * @version   $Id$
 */
public class TagMp3v2 extends LTRmp3 {
  private int     globalSize;
  private Pattern patGenre;
  private boolean v230 = false;     // V2.3.0 detected

  private String  artist  = "";
  private String  comment = "";
  private String  title   = "";
  private String  album   = "";
  private String  year    = "";
  private String  track   = "";
  private String  genre   = "";

  /**
   * Create a new TagMp3v2 instance.
   *
   * @param   in      File to be read
   * @throws  FormatDecodeException     Couldn't decode this file
   */
  public TagMp3v2( RandomAccessFile in )
  throws FormatDecodeException {
    super( in );

    patGenre = Pattern.compile( "\\((\\d{1,3})\\).*" );

    try {
      //--- Decode header ---
      if( !readStringLen( 3 ).equals( "ID3" ) ) {
        throw new FormatDecodeException( "not an id3v2 tag" );
      }

      byte version  = in.readByte();
      byte revision = in.readByte();

      if( version==0xFF || revision==0xFF ) {
        throw new FormatDecodeException( "not an id3v2 tag" );
      }

      if( version<=0x02 || version>0x04 ) {
        throw new FormatDecodeException( "unable to decode ID3v2."+version+"."+revision );
      }

      byte flags  = in.readByte();
      v230 = (version==0x03);