minor changes

This commit is contained in:
ImBenji
2024-03-04 10:37:02 +00:00
parent 429eb4ad5f
commit 564c8853ec
7 changed files with 76586 additions and 6713 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -227,9 +227,11 @@ class AnnouncementModule extends InfoModule {
String audioRoute = "R_${routeVariant.busRoute.routeNumber}_001.mp3";
await announcementCache.loadAnnouncements([audioRoute]);
await announcementCache.loadAnnouncements([audioRoute, "R_RAIL_REPLACEMENT_SERVICE_001.mp3"]);
AudioWrapperSource sourceRoute = AudioWrapperByteSource(announcementCache[audioRoute]!);
AudioWrapperSource sourceRoute = !routeNumber.toLowerCase().startsWith("ul") ?
AudioWrapperByteSource(announcementCache[audioRoute]!) :
AudioWrapperByteSource(announcementCache["R_RAIL_REPLACEMENT_SERVICE_001.mp3"]!);
AudioWrapperSource sourceDestination = AudioWrapperByteSource(await routeVariant.destination!.getAudioBytes());
AnnouncementQueueEntry announcement = AnnouncementQueueEntry(

View File

@@ -113,6 +113,8 @@ class TrackerModule extends InfoModule {
{
// Testing some audio stuff
Uint8List? audioBytes = liveInformation.announcementModule.announcementCache[nearestStop!.getAudioFileName()];
if (audioBytes != null) {
AudioWrapperByteSource audioSource = AudioWrapperByteSource(audioBytes!);
AudioWrapper audio = AudioWrapper();
@@ -122,6 +124,12 @@ class TrackerModule extends InfoModule {
duration = await audio.getDuration();
print("Duration of audio: $duration");
} else {
print("Audio bytes are null");
duration = Duration(seconds: 0);
}
}
// get the estimated distance travelled in 5 seconds, in meters

View File

@@ -52,7 +52,7 @@ class AudioCacheTest extends StatelessWidget {
children: announcements,
);
} else {
return CircularProgressIndicator();
return const CircularProgressIndicator();
}
}
)

View File

@@ -341,17 +341,32 @@ class _Variant extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return AlertDialog(
contentPadding: const EdgeInsets.all(0),
// no curved corners
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
borderRadius: BorderRadius.circular(0),
),
contentPadding: const EdgeInsets.only(
top: 15,
left: 15,
right: 15,
bottom: 8,
content: Container(
decoration: BoxDecoration(
color: Colors.grey.shade900,
border: Border.all(
color: Colors.white70,
width: 2,
)
),
content: Column(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -362,31 +377,43 @@ class _Variant extends StatelessWidget {
style: GoogleFonts.montserrat(
fontSize: 15,
fontWeight: FontWeight.w700,
color: Colors.black,
color: Colors.white70,
height: 1
),
),
SizedBox(height: 4),
Text(
"${route.routeNumber} to ${variant.busStops.last.formattedStopName}",
style: GoogleFonts.montserrat(
fontSize: 15,
fontWeight: FontWeight.w500,
color: Colors.black,
color: Colors.white70,
height: 1
),
),
SizedBox(height: 8),
],
Row(
children: [
Container(
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(
color: Colors.white70,
width: 2,
),
),
actionsPadding: const EdgeInsets.only(
left: 15,
right: 15,
bottom: 15,
),
actions: [
ElevatedButton(
margin: const EdgeInsets.all(0),
padding: const EdgeInsets.all(0),
child: ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
@@ -399,7 +426,21 @@ class _Variant extends StatelessWidget {
child: const Text("Cancel"),
),
ElevatedButton(
),
SizedBox(width: 8),
Container(
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(
color: Colors.white70,
width: 2,
),
),
child: ElevatedButton(
onPressed: () async {
Navigator.of(context).pop();
@@ -423,7 +464,21 @@ class _Variant extends StatelessWidget {
child: const Text("Confirm"),
),
),
],
)
],
),
),
actionsPadding: EdgeInsets.all(0)
);
}
);

View File

@@ -40,6 +40,8 @@ class TfL_Dataset_TestState extends State<TfL_Dataset_Test> {
];
}
ibus_display _ibus_display = ibus_display();
@override
Widget build(BuildContext context) {
@@ -192,7 +194,7 @@ class TfL_Dataset_TestState extends State<TfL_Dataset_Test> {
margin: const EdgeInsets.all(6),
child: ibus_display(),
child: _ibus_display,
),
if (!hideUI)