diff foosdk/sdk/foobar2000/helpers/input_stream_info_reader.h @ 1:20d02a178406 default tip

*: check in everything else yay
author Paper <paper@tflc.us>
date Mon, 05 Jan 2026 02:15:46 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/foosdk/sdk/foobar2000/helpers/input_stream_info_reader.h	Mon Jan 05 02:15:46 2026 -0500
@@ -0,0 +1,35 @@
+#pragma once
+
+#ifdef FOOBAR2000_DESKTOP
+
+template<typename input_t>
+class input_stream_info_reader_impl : public input_stream_info_reader {
+public:
+	input_t theInput;
+
+	uint32_t get_stream_count() {
+		return theInput.get_stream_count();
+	}
+	void get_stream_info(uint32_t index, file_info & out, abort_callback & a) {
+		theInput.get_stream_info(index, out, a);
+	}
+	uint32_t get_default_stream() {
+		return theInput.get_default_stream();
+	}
+};
+
+template<typename input_t>
+class input_stream_info_reader_entry_impl : public input_stream_info_reader_entry {
+public:
+	input_stream_info_reader::ptr open(const char * path, file::ptr fileHint, abort_callback & abort) {
+		typedef input_stream_info_reader_impl<input_t> obj_t;
+		service_ptr_t<obj_t> p = new service_impl_t<obj_t>();
+		p->theInput.open(fileHint, path, input_open_info_read, abort);
+		return p;
+	}
+	GUID get_guid() {
+		return input_t::g_get_guid();
+	}
+};
+
+#endif // FOOBAR2000_DESKTOP