From cf667fc1ed4ff8f8949bf1beb55351196c438f0d Mon Sep 17 00:00:00 2001
From: Ivan Kosarev <ivan@kosarev.info>
Date: Sat, 27 Mar 2021 12:50:45 +0200
Subject: [PATCH] [#23] Hide the samples generator.

---
 zx/_emulator.py | 2 --
 zx/_playback.py | 4 +++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/zx/_emulator.py b/zx/_emulator.py
index 2bcc621..dafd07b 100644
--- a/zx/_emulator.py
+++ b/zx/_emulator.py
@@ -333,8 +333,6 @@ def __load_input_recording(self, file):
         self.set_breakpoint(0x04d4)
 
         # Process frames in order.
-        self.__playback_player.samples = (
-            self.__playback_player.get_playback_samples())
         sample = None
         for sample in self.__playback_player.samples:
             break
diff --git a/zx/_playback.py b/zx/_playback.py
index ec6a525..055e113 100644
--- a/zx/_playback.py
+++ b/zx/_playback.py
@@ -20,6 +20,8 @@ def __init__(self, machine, file):
         assert isinstance(file, RZXFile)
         self._recording = file
 
+        self.samples = self.__get_playback_samples()
+
     def find_recording_info_chunk(self):
         for chunk in self._recording['chunks']:
             if chunk['id'] == 'info':
@@ -29,7 +31,7 @@ def find_recording_info_chunk(self):
     def get_chunks(self):
         return self._recording['chunks']
 
-    def get_playback_samples(self):
+    def __get_playback_samples(self):
         # TODO: Have a class describing playback state.
         self.playback_frame_count = 0
         self.playback_chunk = 0