diff --git a/README.md b/README.md index 170139d..9f069ce 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,38 @@ The classical music player and organizer. https://musicus.org +## Project structure + +The top level directories contain the main Musicus packages, of which some +depend on other ones. All packages are written in [Dart](https://dart.dev). + +### `database` + +A Database of classical music. This package will be used by all standalone +Musicus applications for storing classical music metadata. + +### `mobile` + +The Musicus mobile app. It is being developed using +[Flutter toolkit](https://flutter.dev) and only runs on Android for now. + +### `player` + +The simplest possible audio player plugin. This is used by the mobile app for +playback. + ## Hacking +Picking up Dart as a programming language and Flutter as an UI toolkit should +be relatively straight forward. You can visit +[this page](https://flutter.dev/docs/get-started/install) to get started with +Flutter. After cloning the Musicus repository, it works best to work at its +subcomponents one at a time. I recommend +[VS Code](https://flutter.dev/docs/get-started/editor?tab=vscode) for editing. +Please contact me via e-mail (see my profile), if you have any questions or +need help. I'm also open to ideas for the future of Musicus! Please use the +issue tracker for them. + You can use the following command to automatically update generated code while working on Musicus: diff --git a/database/.gitignore b/database/.gitignore new file mode 100644 index 0000000..a242fcb --- /dev/null +++ b/database/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# VS Code related +.vscode/ + +# Flutter/Dart/Pub related +**/*.g.dart +**/doc/api/ +.dart_tool/ +pubspec.lock +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ diff --git a/mobile/build.yaml b/database/build.yaml similarity index 100% rename from mobile/build.yaml rename to database/build.yaml diff --git a/database/lib/musicus_database.dart b/database/lib/musicus_database.dart new file mode 100644 index 0000000..63a040b --- /dev/null +++ b/database/lib/musicus_database.dart @@ -0,0 +1 @@ +export 'src/database.dart'; \ No newline at end of file diff --git a/mobile/lib/database.dart b/database/lib/src/database.dart similarity index 100% rename from mobile/lib/database.dart rename to database/lib/src/database.dart diff --git a/mobile/lib/database.moor b/database/lib/src/database.moor similarity index 100% rename from mobile/lib/database.moor rename to database/lib/src/database.moor diff --git a/database/pubspec.yaml b/database/pubspec.yaml new file mode 100644 index 0000000..9377c4d --- /dev/null +++ b/database/pubspec.yaml @@ -0,0 +1,14 @@ +name: musicus_database +description: A database for classical music. +version: 0.0.1 + +environment: + sdk: ">=2.3.0 <3.0.0" + +dependencies: + moor: + moor_ffi: + +dev_dependencies: + build_runner: + moor_generator: \ No newline at end of file diff --git a/mobile/lib/backend.dart b/mobile/lib/backend.dart index 0667b8f..cbd5793 100644 --- a/mobile/lib/backend.dart +++ b/mobile/lib/backend.dart @@ -6,11 +6,11 @@ import 'package:flutter/widgets.dart'; import 'package:moor/isolate.dart'; import 'package:moor/moor.dart'; import 'package:moor_ffi/moor_ffi.dart'; +import 'package:musicus_database/musicus_database.dart'; import 'package:path/path.dart' as p; import 'package:path_provider/path_provider.dart' as pp; import 'package:shared_preferences/shared_preferences.dart'; -import 'database.dart'; import 'music_library.dart'; import 'player.dart'; diff --git a/mobile/lib/editors/ensemble.dart b/mobile/lib/editors/ensemble.dart index a2539f2..2ac1ba3 100644 --- a/mobile/lib/editors/ensemble.dart +++ b/mobile/lib/editors/ensemble.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; class EnsembleEditor extends StatefulWidget { final Ensemble ensemble; diff --git a/mobile/lib/editors/instrument.dart b/mobile/lib/editors/instrument.dart index b2aedc6..6893bc8 100644 --- a/mobile/lib/editors/instrument.dart +++ b/mobile/lib/editors/instrument.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; class InstrumentEditor extends StatefulWidget { final Instrument instrument; diff --git a/mobile/lib/editors/person.dart b/mobile/lib/editors/person.dart index 8deee41..1cb5170 100644 --- a/mobile/lib/editors/person.dart +++ b/mobile/lib/editors/person.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; class PersonEditor extends StatefulWidget { final Person person; diff --git a/mobile/lib/editors/recording.dart b/mobile/lib/editors/recording.dart index bfcf5a7..9d2beb7 100644 --- a/mobile/lib/editors/recording.dart +++ b/mobile/lib/editors/recording.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../selectors/performer.dart'; import '../selectors/work.dart'; import '../widgets/texts.dart'; diff --git a/mobile/lib/editors/tracks.dart b/mobile/lib/editors/tracks.dart index b41f013..b6c1a9b 100644 --- a/mobile/lib/editors/tracks.dart +++ b/mobile/lib/editors/tracks.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../music_library.dart'; import '../selectors/files.dart'; import '../selectors/recording.dart'; diff --git a/mobile/lib/editors/work.dart b/mobile/lib/editors/work.dart index 6f77b48..145acc7 100644 --- a/mobile/lib/editors/work.dart +++ b/mobile/lib/editors/work.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../selectors/instruments.dart'; import '../selectors/person.dart'; diff --git a/mobile/lib/screens/home.dart b/mobile/lib/screens/home.dart index c7ebf2f..e556700 100644 --- a/mobile/lib/screens/home.dart +++ b/mobile/lib/screens/home.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/tracks.dart'; import 'person.dart'; diff --git a/mobile/lib/screens/person.dart b/mobile/lib/screens/person.dart index 77ac945..5d1e49a 100644 --- a/mobile/lib/screens/person.dart +++ b/mobile/lib/screens/person.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/person.dart'; import 'work.dart'; diff --git a/mobile/lib/screens/program.dart b/mobile/lib/screens/program.dart index 6339c5d..0d19588 100644 --- a/mobile/lib/screens/program.dart +++ b/mobile/lib/screens/program.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../music_library.dart'; import '../widgets/play_pause_button.dart'; import '../widgets/recording_tile.dart'; diff --git a/mobile/lib/screens/work.dart b/mobile/lib/screens/work.dart index 59563c7..33d28c8 100644 --- a/mobile/lib/screens/work.dart +++ b/mobile/lib/screens/work.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/work.dart'; import '../widgets/texts.dart'; diff --git a/mobile/lib/selectors/instruments.dart b/mobile/lib/selectors/instruments.dart index 23cfba7..7f7ca90 100644 --- a/mobile/lib/selectors/instruments.dart +++ b/mobile/lib/selectors/instruments.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/instrument.dart'; class InstrumentsSelector extends StatefulWidget { diff --git a/mobile/lib/selectors/performer.dart b/mobile/lib/selectors/performer.dart index 9a4541d..b270c27 100644 --- a/mobile/lib/selectors/performer.dart +++ b/mobile/lib/selectors/performer.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/ensemble.dart'; import '../editors/person.dart'; diff --git a/mobile/lib/selectors/person.dart b/mobile/lib/selectors/person.dart index 553c9d0..40fc7ef 100644 --- a/mobile/lib/selectors/person.dart +++ b/mobile/lib/selectors/person.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/person.dart'; class PersonsSelector extends StatelessWidget { diff --git a/mobile/lib/selectors/recording.dart b/mobile/lib/selectors/recording.dart index 0eb29d2..d4aba4f 100644 --- a/mobile/lib/selectors/recording.dart +++ b/mobile/lib/selectors/recording.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/recording.dart'; import '../widgets/texts.dart'; import '../widgets/works_by_composer.dart'; diff --git a/mobile/lib/selectors/work.dart b/mobile/lib/selectors/work.dart index e42ebfc..5a306b9 100644 --- a/mobile/lib/selectors/work.dart +++ b/mobile/lib/selectors/work.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import '../editors/work.dart'; // TODO: Lazy load works and/or optimize queries. diff --git a/mobile/lib/widgets/player_bar.dart b/mobile/lib/widgets/player_bar.dart index 732cabe..cef90c1 100644 --- a/mobile/lib/widgets/player_bar.dart +++ b/mobile/lib/widgets/player_bar.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:musicus/database.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; import '../music_library.dart'; diff --git a/mobile/lib/widgets/recording_tile.dart b/mobile/lib/widgets/recording_tile.dart index bdc5727..61a5bb4 100644 --- a/mobile/lib/widgets/recording_tile.dart +++ b/mobile/lib/widgets/recording_tile.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; import 'texts.dart'; diff --git a/mobile/lib/widgets/texts.dart b/mobile/lib/widgets/texts.dart index a524082..1cb42ea 100644 --- a/mobile/lib/widgets/texts.dart +++ b/mobile/lib/widgets/texts.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; class EnsembleText extends StatelessWidget { final int ensembleId; diff --git a/mobile/lib/widgets/works_by_composer.dart b/mobile/lib/widgets/works_by_composer.dart index 0fb7a71..ba4a799 100644 --- a/mobile/lib/widgets/works_by_composer.dart +++ b/mobile/lib/widgets/works_by_composer.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:musicus_database/musicus_database.dart'; import '../backend.dart'; -import '../database.dart'; class WorksByComposer extends StatelessWidget { final int personId; diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index 37509c8..4a67da8 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -14,6 +14,8 @@ dependencies: sdk: flutter moor: moor_ffi: + musicus_database: + path: ../database musicus_player: path: ../player path: @@ -21,10 +23,6 @@ dependencies: rxdart: shared_preferences: -dev_dependencies: - build_runner: - moor_generator: - flutter: uses-material-design: true fonts: