Giter Site home page Giter Site logo

my_lyric's Introduction

A Flutter package to encode and decode lrc.

Features

  • You can use it to parse music lyric String (.lrc), lrc look like:
    • [00.11.22] hello coolight
  • And than return a object for reading and writing easily.
  • my_lyric support so many lrc standard and non-standard format,
  • we follow casually decode and strictly encode
  • such as:
  • info:
    • [ti:xxx]
    • [ar:xxx]
    • [hello:xxx]
    • ......
  • lyric:
    • [minute:second.millisecond] lyricContent
      • like [01:11.22] hello
    • [minute:second:millisecond] lyricContent
      • like [01:11:22] hello
    • [minute:second] lyricContent
      • like [01:11] hello
    • translate:
      • no time Or same time:
[01:11.22] lyricContent1
lyricContent1 translate

[01:33.22] lyricContent2
[01:33.22] lyricContent2 translate
  • mulit-time in one line:
    • [minute:second.millisecond][minute2:second2] lyricContent To:
    • [minute:second.millisecond] lyricContent
    • And [minute2:second2] lyricContent
  • time after lyricContent:
    • lyricContent [minute:second.millisecond]

Getting started

  • install this package, add this line in your pubspec.yaml:
my_lyric: 
  • import when you want to use this package:
import 'package:my_lyric/MyLyric.dart';

Usage

  • parse .lrc String to Objects:
void test() {
    final lrcStr = """
[ti:天后]
[ar:陈势安]
[00:27.43]终于找到借口
[00:30.33]趁着醉意上心头
[00:33.28]表达我所有感受
""";
    final relist = MyLyric_c.decodeLrcString(
        lrcStr,
    );
}
  • encode to .lrc:
void test() async {
    // lrc object list
    final List<LyricSrcItemEntity_c> lrcList = [];
    final lrcStr = MyLyric_c.encodeLrcString(
        lrcList,
    );
    /// write to file:
    final file = File("./test.lrc");
    // create file
    if(false == await file.exists()) {
      await file.create(recursive: true);
    }
    // write
    await refile.writeAsString(lrcStr);
}

my_lyric's People

Contributors

coolight7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.